<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/prism/options.c, branch v4.0.3</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>Prism update for 4.0</title>
<updated>2025-11-07T11:42:29+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-10-30T05:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f4e01783d3412b10f9978b5297142979cb067ce8'/>
<id>f4e01783d3412b10f9978b5297142979cb067ce8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Do not use `0` to indicate the latest ruby version to parse</title>
<updated>2025-07-29T17:17:28+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-07-22T11:16:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=026079925c2ce7ff660d5e1ba8e2e0d7b0cc6b02'/>
<id>026079925c2ce7ff660d5e1ba8e2e0d7b0cc6b02</id>
<content type='text'>
This makes it hard to do version checks against this value. The current version checks work because there are so few possible values at the moment.

As an example, PR 3337 introduces new syntax for ruby 3.5 and uses `PM_OPTIONS_VERSION_LATEST` as its version guard. Because what is considered the latest changes every year, it must later be changed to `parser-&gt;version == parser-&gt;version == PM_OPTIONS_VERSION_CRUBY_3_5 || parser-&gt;version == PM_OPTIONS_VERSION_LATEST`, with one extra version each year.

With this change, the PR can instead write `parser-&gt;version &gt;= PM_OPTIONS_VERSION_CRUBY_3_5` which is self-explanatory
and works for future versions.

https://github.com/ruby/prism/commit/8318a113ca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it hard to do version checks against this value. The current version checks work because there are so few possible values at the moment.

As an example, PR 3337 introduces new syntax for ruby 3.5 and uses `PM_OPTIONS_VERSION_LATEST` as its version guard. Because what is considered the latest changes every year, it must later be changed to `parser-&gt;version == parser-&gt;version == PM_OPTIONS_VERSION_CRUBY_3_5 || parser-&gt;version == PM_OPTIONS_VERSION_LATEST`, with one extra version each year.

With this change, the PR can instead write `parser-&gt;version &gt;= PM_OPTIONS_VERSION_CRUBY_3_5` which is self-explanatory
and works for future versions.

https://github.com/ruby/prism/commit/8318a113ca
</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] 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>
<entry>
<title>[ruby/prism] Accept all 3.3.x and 3.4.x Ruby versions for Prism.parse</title>
<updated>2024-09-24T12:24:19+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2024-09-17T20:44:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ed4a55fc4d7dc5f9f95983f4713cbd0c733601a3'/>
<id>ed4a55fc4d7dc5f9f95983f4713cbd0c733601a3</id>
<content type='text'>
https://github.com/ruby/prism/commit/a4fcd5339a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/a4fcd5339a
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Introduce partial_script option</title>
<updated>2024-09-20T15:42:12+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-09-20T15:20:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f515a1ab4b04ae79e02194e1f25a400b9f3f8f66'/>
<id>f515a1ab4b04ae79e02194e1f25a400b9f3f8f66</id>
<content type='text'>
https://github.com/ruby/prism/commit/b28877fa4f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/b28877fa4f
</pre>
</div>
</content>
</entry>
</feed>
