<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/prism/parse_test.rb, branch master</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/prism] Tests overhaul</title>
<updated>2024-05-30T19:18:20+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-05-29T14:12:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=72452f43871b8034bfa718ed823bc62b5b81d6f9'/>
<id>72452f43871b8034bfa718ed823bc62b5b81d6f9</id>
<content type='text'>
https://github.com/ruby/prism/commit/6f886be0a4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/6f886be0a4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Remove Debug module</title>
<updated>2024-05-24T17:19:38+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-05-24T16:48:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f8b750370e1fc3b08d152794e39d389d9586fabe'/>
<id>f8b750370e1fc3b08d152794e39d389d9586fabe</id>
<content type='text'>
https://github.com/ruby/prism/commit/4d8929ff6a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/4d8929ff6a
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Allow block exits in defined? and fix modifier while/until</title>
<updated>2024-04-03T21:34:12+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-04-02T19:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=198d197aeb79566673db2440a3b90ff87ff279cd'/>
<id>198d197aeb79566673db2440a3b90ff87ff279cd</id>
<content type='text'>
https://github.com/ruby/prism/commit/2752f0b8df
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/2752f0b8df
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Check for syntax errors using RubyVM</title>
<updated>2024-04-03T21:34:12+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-04-02T16:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=664a5082cb7aa961f88e2b1e71917fc508599022'/>
<id>664a5082cb7aa961f88e2b1e71917fc508599022</id>
<content type='text'>
https://github.com/ruby/prism/commit/9e200dd1c1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/9e200dd1c1
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Update fixtures to be all valid Ruby</title>
<updated>2024-04-03T21:34:12+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-04-02T16:19:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e454cf22023c95e80689bb26ab1abd2775015fbf'/>
<id>e454cf22023c95e80689bb26ab1abd2775015fbf</id>
<content type='text'>
https://github.com/ruby/prism/commit/a0b978d25b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/a0b978d25b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix typos</title>
<updated>2024-03-26T10:51:12+00:00</updated>
<author>
<name>Koichi ITO</name>
<email>koic.ito@gmail.com</email>
</author>
<published>2024-03-24T11:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=52cf6ec46b744a2ac34d9f6531520bf2aee017f5'/>
<id>52cf6ec46b744a2ac34d9f6531520bf2aee017f5</id>
<content type='text'>
After finding the "if if" typo, some additional typos identified by running `codespell` are also being corrected:
https://github.com/codespell-project/codespell

https://github.com/ruby/prism/commit/e6a34cfeeb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After finding the "if if" typo, some additional typos identified by running `codespell` are also being corrected:
https://github.com/codespell-project/codespell

https://github.com/ruby/prism/commit/e6a34cfeeb
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Provide options for reducing size</title>
<updated>2024-03-20T21:32:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-03-20T14:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=af7bf9e0d8fd5e542781ca7ac9550e3011913924'/>
<id>af7bf9e0d8fd5e542781ca7ac9550e3011913924</id>
<content type='text'>
https://github.com/ruby/prism/commit/592128de4d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/592128de4d
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround for `Prism::ParseTest#test_filepath` for "unparser/corpus/literal/def.txt"</title>
<updated>2024-02-20T08:33:58+00:00</updated>
<author>
<name>yui-knk</name>
<email>spiketeika@gmail.com</email>
</author>
<published>2024-02-16T08:33:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2a4b6ed37cbb7acb622703be4db770457c2b72cc'/>
<id>2a4b6ed37cbb7acb622703be4db770457c2b72cc</id>
<content type='text'>
See the discussion on https://github.com/ruby/ruby/pull/9923
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See the discussion on https://github.com/ruby/ruby/pull/9923
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip `test_filepath` of "unparser/corpus/literal/def.txt"</title>
<updated>2024-02-20T08:33:58+00:00</updated>
<author>
<name>yui-knk</name>
<email>spiketeika@gmail.com</email>
</author>
<published>2024-02-05T04:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=20dbc7a5f4098ec7612192c2b65bdc970eab6055'/>
<id>20dbc7a5f4098ec7612192c2b65bdc970eab6055</id>
<content type='text'>
The previous commit changes Ripper lex state behavior of `tLABEL`.
For example, Ripper lex state for the second `bar` was changed
by the previous commit.

```
def foo(bar: bar())
end
```

Before the commit, Ripper didn’t add label `bar` id to `vtable`
because `formal_argument` function for Ripper didn’t return id
but returned `VALUE lhs`.
Therefore Ripper didn’t `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` for following `bar`
in `parse_ident` because `lvar_defined` for following `bar` was not true.

Currently Ripper does `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` then
the result of this test case is changed like below.

```
Prism::ParseTest#test_filepath_unparser/corpus/literal/def.txt [ruby/test/prism/parse_test.rb:280]:
&lt;[[80, 13], :on_ident, “bar”, END|LABEL]&gt; expected but was
&lt;[[80, 13], :on_ident, “bar”, ARG]&gt;.
```

Parser sets lex state to `END|LABEL` on master branch.
Therefore previous commit makes Ripper’s behavior aligned with parser’s behavior.

```
$ ruby -v -y -e "def foo(bar: bar())" -e "end"
ruby 3.4.0dev (2024-02-11T23:52:05Z master 697ade7bda) [arm64-darwin21]
...
Reading a token
parser_dispatch_scan_event:11210 (1: 12|1|7)
lex_state: ARG|LABELED -&gt; ARG at line 11113
lex_state: ARG -&gt; END|LABEL at line 11128
parser_dispatch_scan_event:11877 (1: 13|3|4)
Next token is token “local variable or method” (1.13-1.16: bar)
Shifting token “local variable or method” (1.13-1.16: bar)
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous commit changes Ripper lex state behavior of `tLABEL`.
For example, Ripper lex state for the second `bar` was changed
by the previous commit.

```
def foo(bar: bar())
end
```

Before the commit, Ripper didn’t add label `bar` id to `vtable`
because `formal_argument` function for Ripper didn’t return id
but returned `VALUE lhs`.
Therefore Ripper didn’t `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` for following `bar`
in `parse_ident` because `lvar_defined` for following `bar` was not true.

Currently Ripper does `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` then
the result of this test case is changed like below.

```
Prism::ParseTest#test_filepath_unparser/corpus/literal/def.txt [ruby/test/prism/parse_test.rb:280]:
&lt;[[80, 13], :on_ident, “bar”, END|LABEL]&gt; expected but was
&lt;[[80, 13], :on_ident, “bar”, ARG]&gt;.
```

Parser sets lex state to `END|LABEL` on master branch.
Therefore previous commit makes Ripper’s behavior aligned with parser’s behavior.

```
$ ruby -v -y -e "def foo(bar: bar())" -e "end"
ruby 3.4.0dev (2024-02-11T23:52:05Z master 697ade7bda) [arm64-darwin21]
...
Reading a token
parser_dispatch_scan_event:11210 (1: 12|1|7)
lex_state: ARG|LABELED -&gt; ARG at line 11113
lex_state: ARG -&gt; END|LABEL at line 11128
parser_dispatch_scan_event:11877 (1: 13|3|4)
Next token is token “local variable or method” (1.13-1.16: bar)
Shifting token “local variable or method” (1.13-1.16: bar)
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Initialize the Prism::Source directly with all 3 fields for the C extension</title>
<updated>2024-02-14T15:48:33+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2024-02-14T12:43:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c2d8d6eba6a1c9e51c2f2ae136e92468c6841472'/>
<id>c2d8d6eba6a1c9e51c2f2ae136e92468c6841472</id>
<content type='text'>
* Faster that way:
  $ ruby -Ilib -rprism -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("parse") { Prism.parse("1 + 2") } }'
  195.722k (± 0.5%) i/s
  rb_iv_set():
  179.609k (± 0.5%) i/s
  rb_funcall():
  190.030k (± 0.3%) i/s
  before this PR:
  183.319k (± 0.4%) i/s
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Faster that way:
  $ ruby -Ilib -rprism -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("parse") { Prism.parse("1 + 2") } }'
  195.722k (± 0.5%) i/s
  rb_iv_set():
  179.609k (± 0.5%) i/s
  rb_funcall():
  190.030k (± 0.3%) i/s
  before this PR:
  183.319k (± 0.4%) i/s
</pre>
</div>
</content>
</entry>
</feed>
