<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/prism/api, branch v4.0.2</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] Add Ruby 4.1 as a version specifier</title>
<updated>2025-12-19T00:58:53+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-12-17T09:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=76248400b75d42288a5941aa03e2d2e6d4fac057'/>
<id>76248400b75d42288a5941aa03e2d2e6d4fac057</id>
<content type='text'>
https://github.com/ruby/prism/commit/138db9ccc4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/138db9ccc4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Rename Ruby 3.5 to Ruby 4.0</title>
<updated>2025-11-08T00:22:17+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-11-07T12:14:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7037d8f89e71a13547d031d76747e45cfe930c9f'/>
<id>7037d8f89e71a13547d031d76747e45cfe930c9f</id>
<content type='text'>
See https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523

It leaves the old variant around. RuboCop for examples accesses `Prism::Translation::Parser35`
to test against ruby-head. For now I left these simply as an alias

https://github.com/ruby/prism/commit/d0a823f045
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523

It leaves the old variant around. RuboCop for examples accesses `Prism::Translation::Parser35`
to test against ruby-head. For now I left these simply as an alias

https://github.com/ruby/prism/commit/d0a823f045
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Do not rely on RUBY_VERSION being consistent</title>
<updated>2025-10-16T14:38:14+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-10-16T14:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=68f45a6da7bcea9126e04653a5ab47ddcb3b3126'/>
<id>68f45a6da7bcea9126e04653a5ab47ddcb3b3126</id>
<content type='text'>
https://github.com/ruby/prism/commit/34428946db
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/34428946db
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Do not stub Ruby version</title>
<updated>2025-10-16T14:10:39+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-10-16T14:10:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cea3307fe61992f576dd665ae1066e8073b53dab'/>
<id>cea3307fe61992f576dd665ae1066e8073b53dab</id>
<content type='text'>
https://github.com/ruby/prism/commit/44c4306247
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/44c4306247
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add support for `Prism.parse(foo, version: "current")`</title>
<updated>2025-10-16T12:34:14+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-10-15T06:46:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f5d3b6e6261569a7205b637052d1fec45ae4620b'/>
<id>f5d3b6e6261569a7205b637052d1fec45ae4620b</id>
<content type='text'>
The docs currently say to use `Prism.parse(foo, version: RUBY_VERSION)` for this.
By specifying "current" instead, we can have prism raise a more specifc error.

Note: Does not use `ruby_version` from `ruby/version.h` because writing a test for that is not really possible.
`RUBY_VERSION` is nicely stubbable for both the c-ext and FFI backend.

https://github.com/ruby/prism/commit/9c5cd205cf
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The docs currently say to use `Prism.parse(foo, version: RUBY_VERSION)` for this.
By specifying "current" instead, we can have prism raise a more specifc error.

Note: Does not use `ruby_version` from `ruby/version.h` because writing a test for that is not really possible.
`RUBY_VERSION` is nicely stubbable for both the c-ext and FFI backend.

https://github.com/ruby/prism/commit/9c5cd205cf
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Support forwarding flags on scopes</title>
<updated>2025-01-14T20:31:38+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-01-14T18:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=51d3d6ac8c2e3b6b6dacd80a9ddf11adc46fde08'/>
<id>51d3d6ac8c2e3b6b6dacd80a9ddf11adc46fde08</id>
<content type='text'>
When parent scopes around an eval are forwarding parameters (like
*, **, &amp;, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.

The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.

In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.

All of this is in service of properly parsing the following code:

```ruby
def foo(*) = eval("bar(*)")
```

https://github.com/ruby/prism/commit/21abb6b7c4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When parent scopes around an eval are forwarding parameters (like
*, **, &amp;, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.

The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.

In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.

All of this is in service of properly parsing the following code:

```ruby
def foo(*) = eval("bar(*)")
```

https://github.com/ruby/prism/commit/21abb6b7c4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Freeze AST option</title>
<updated>2025-01-14T15:32:39+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-01-12T02:10:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=713f31872a42b75924d346ce5df3e567db074cc5'/>
<id>713f31872a42b75924d346ce5df3e567db074cc5</id>
<content type='text'>
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.

https://github.com/ruby/prism/commit/8e6a93b2d2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.

https://github.com/ruby/prism/commit/8e6a93b2d2
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Support 3.5 for version option</title>
<updated>2025-01-12T00:09:05+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-12-21T20:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b79152fd22f1acb4c984ca205e2de4f5f6291e90'/>
<id>b79152fd22f1acb4c984ca205e2de4f5f6291e90</id>
<content type='text'>
https://github.com/ruby/prism/commit/6b6aa05bfb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/6b6aa05bfb
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Set contains_keywords flag for implicit gets($/, chomp: true) method call to handle -l CLI option</title>
<updated>2024-10-07T15:52:22+00:00</updated>
<author>
<name>Andrew Konchin</name>
<email>andry.konchin@gmail.com</email>
</author>
<published>2024-10-07T12:36:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8d359644e7a71c4835b8f385c308571a7a8baf7f'/>
<id>8d359644e7a71c4835b8f385c308571a7a8baf7f</id>
<content type='text'>
https://github.com/ruby/prism/commit/717e41c87d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/717e41c87d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Accept version shorthand like 3.4</title>
<updated>2024-09-24T13:21:36+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-09-24T12:41:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=414a848cc6697067a988e056a787a0a7689c344b'/>
<id>414a848cc6697067a988e056a787a0a7689c344b</id>
<content type='text'>
https://github.com/ruby/prism/commit/098f1c4607
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/098f1c4607
</pre>
</div>
</content>
</entry>
</feed>
