<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/prism/prism.h, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Bump Prism version to 1.5.0</title>
<updated>2025-09-12T21:30:16+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-09-12T20:09:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=52b3f006cb31672c45b26f6a44a609fd1b8e2ee5'/>
<id>52b3f006cb31672c45b26f6a44a609fd1b8e2ee5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>When reading from stdin, put a wrapper around the IO object</title>
<updated>2025-08-27T16:07:32+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=1f421d092bb8c290df5cfc9e95a01e279ebadc42'/>
<id>1f421d092bb8c290df5cfc9e95a01e279ebadc42</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.

[Backport #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.

[Backport #21188]
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Prism::StringQuery</title>
<updated>2024-10-11T19:34:57+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-10-11T18:43:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5f62522d5b8bd162ddf657680b8532eadeaae21f'/>
<id>5f62522d5b8bd162ddf657680b8532eadeaae21f</id>
<content type='text'>
Introduce StringQuery to provide methods to access some metadata
about the Ruby lexer.

https://github.com/ruby/prism/commit/d3f55b67b9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce StringQuery to provide methods to access some metadata
about the Ruby lexer.

https://github.com/ruby/prism/commit/d3f55b67b9
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Remove error formatting, put directly in CRuby</title>
<updated>2024-05-24T17:19:36+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-05-24T16:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79001c8b4a35f12b6115916de2f2671168b97ae1'/>
<id>79001c8b4a35f12b6115916de2f2671168b97ae1</id>
<content type='text'>
https://github.com/ruby/prism/commit/53b2866487
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/53b2866487
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Replace . with decimal point for strtod</title>
<updated>2024-04-01T19:39:33+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-04-01T19:28:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b25282e61844334c70def2d678c19c6105646ab3'/>
<id>b25282e61844334c70def2d678c19c6105646ab3</id>
<content type='text'>
https://github.com/ruby/prism/commit/578a4f983e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/578a4f983e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add option for inlining messages for error formatting</title>
<updated>2024-03-27T17:03:11+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-03-27T16:04:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9b816e674a4ecadde047212827e3bbe87cd61345'/>
<id>9b816e674a4ecadde047212827e3bbe87cd61345</id>
<content type='text'>
https://github.com/ruby/prism/commit/af0204a8ab
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/af0204a8ab
</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>[ruby/prism] Remove restrict to fix windows 2015</title>
<updated>2024-03-07T21:23:18+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-03-07T21:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=977012bae8100524a691f5850a462728b20e219d'/>
<id>977012bae8100524a691f5850a462728b20e219d</id>
<content type='text'>
https://github.com/ruby/prism/commit/f0a2ce1c0e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/f0a2ce1c0e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Support parsing streams</title>
<updated>2024-03-07T20:40:39+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-03-07T20:24:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ec159fc8ba17cb70e34a5b62c1ef804e393b7b2f'/>
<id>ec159fc8ba17cb70e34a5b62c1ef804e393b7b2f</id>
<content type='text'>
https://github.com/ruby/prism/commit/efdc2b7222
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/efdc2b7222
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Duplicated hash keys</title>
<updated>2024-02-23T18:25:31+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-02-23T15:36:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d1ce989829927a4215952983babadfd1df1b505f'/>
<id>d1ce989829927a4215952983babadfd1df1b505f</id>
<content type='text'>
https://github.com/ruby/prism/commit/3e10c46c14
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/3e10c46c14
</pre>
</div>
</content>
</entry>
</feed>
