<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/prism/ffi.rb, 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] 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>When reading from stdin, put a wrapper around the IO object</title>
<updated>2025-08-04T19:34:33+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-07-17T22:20:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89d89fa49d387a09e0d3ea7092a598b88d6d86eb'/>
<id>89d89fa49d387a09e0d3ea7092a598b88d6d86eb</id>
<content type='text'>
The purpose of this commit is to fix Bug #21188.  We need to detect when
stdin has run in to an EOF case.  Unfortunately we can't _call_ the eof
function on IO because it will block.

Here is a short script to demonstrate the issue:

```ruby
x = STDIN.gets
puts x
puts x.eof?
```

If you run the script, then type some characters (but _NOT_ a newline),
then hit Ctrl-D twice, it will print the input string.  Unfortunately,
calling `eof?` will try to read from STDIN again causing us to need a
3rd Ctrl-D to exit the program.

Before introducing the EOF callback to Prism, the input loop looked
kind of like this:

```ruby
loop do
  str = STDIN.gets
  process(str)

  if str.nil?
    p :DONE
  end
end
```

Which required 3 Ctrl-D to exit.  If we naively changed it to something
like this:

```ruby
loop do
  str = STDIN.gets
  process(str)

  if STDIN.eof?
    p :DONE
  end
end
```

It would still require 3 Ctrl-D because `eof?` would block.  In this
patch, we're wrapping the IO object, checking the buffer for a newline
and length, and then using that to simulate a non-blocking eof? method.

This commit wraps STDIN and emulates a non-blocking `eof` function.

[Bug #21188]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of this commit is to fix Bug #21188.  We need to detect when
stdin has run in to an EOF case.  Unfortunately we can't _call_ the eof
function on IO because it will block.

Here is a short script to demonstrate the issue:

```ruby
x = STDIN.gets
puts x
puts x.eof?
```

If you run the script, then type some characters (but _NOT_ a newline),
then hit Ctrl-D twice, it will print the input string.  Unfortunately,
calling `eof?` will try to read from STDIN again causing us to need a
3rd Ctrl-D to exit the program.

Before introducing the EOF callback to Prism, the input loop looked
kind of like this:

```ruby
loop do
  str = STDIN.gets
  process(str)

  if str.nil?
    p :DONE
  end
end
```

Which required 3 Ctrl-D to exit.  If we naively changed it to something
like this:

```ruby
loop do
  str = STDIN.gets
  process(str)

  if STDIN.eof?
    p :DONE
  end
end
```

It would still require 3 Ctrl-D because `eof?` would block.  In this
patch, we're wrapping the IO object, checking the buffer for a newline
and length, and then using that to simulate a non-blocking eof? method.

This commit wraps STDIN and emulates a non-blocking `eof` function.

[Bug #21188]
</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] [DOC] Specify markdown mode to RDoc</title>
<updated>2025-05-29T04:45:58+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-05-28T10:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=991cf2dd4d611d5a8b275dfb3ec83c4d25799629'/>
<id>991cf2dd4d611d5a8b275dfb3ec83c4d25799629</id>
<content type='text'>
https://github.com/ruby/prism/commit/12af4e144e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/12af4e144e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Mark Prism as ractor-safe</title>
<updated>2025-03-19T21:11:57+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-03-19T20:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=641f15b1c6bd8921407a1f045573d3b0605f00d3'/>
<id>641f15b1c6bd8921407a1f045573d3b0605f00d3</id>
<content type='text'>
https://github.com/ruby/prism/commit/c02429765b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/c02429765b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Revert "Mark extension as Ractor-safe"</title>
<updated>2025-03-12T19:56:22+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-03-12T19:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=af76b7f4d9f791b8d20f567e0fa8a45488fa00b8'/>
<id>af76b7f4d9f791b8d20f567e0fa8a45488fa00b8</id>
<content type='text'>
https://github.com/ruby/prism/commit/56eaf53732
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/56eaf53732
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Mark extension as Ractor-safe</title>
<updated>2025-03-12T19:15:03+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-03-12T17:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=242e99eb0f32e1705413d084126be4ae6525a804'/>
<id>242e99eb0f32e1705413d084126be4ae6525a804</id>
<content type='text'>
https://github.com/ruby/prism/commit/10e5431b38
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/10e5431b38
</pre>
</div>
</content>
</entry>
</feed>
