<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/prism/extension.c, 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>merge revision(s) f27ed98effff9891d28edc7119d45811bcedd510: [Backport #21183]</title>
<updated>2025-04-14T07:20:04+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-04-14T07:20:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7b5e4125b9935cd78d80719de018dad446780e40'/>
<id>7b5e4125b9935cd78d80719de018dad446780e40</id>
<content type='text'>
	[ruby/prism] Freeze `Prism::VERSION`

	Closes https://github.com/ruby/prism/pull/3422

	https://github.com/ruby/prism/commit/b488a84253
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[ruby/prism] Freeze `Prism::VERSION`

	Closes https://github.com/ruby/prism/pull/3422

	https://github.com/ruby/prism/commit/b488a84253
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Supress string_query function warning</title>
<updated>2024-10-13T12:22:58+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2024-10-12T12:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6393d2950ddcaa75f92cde9917cf3e4edf9b5347'/>
<id>6393d2950ddcaa75f92cde9917cf3e4edf9b5347</id>
<content type='text'>
https://github.com/ruby/prism/commit/0635814327
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/0635814327
</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] 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] check_string() should always return a valid C string</title>
<updated>2024-09-24T12:24:19+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2024-09-20T20:20:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b8baf3f3ee7727682cddafb6e7a589ac2a220a38'/>
<id>b8baf3f3ee7727682cddafb6e7a589ac2a220a38</id>
<content type='text'>
* Otherwise it is invalid e.g. to call strlen() to the result,
  or to assume the argument was a string.
* All callers are already checking for nil before.

https://github.com/ruby/prism/commit/8197be883e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Otherwise it is invalid e.g. to call strlen() to the result,
  or to assume the argument was a string.
* All callers are already checking for nil before.

https://github.com/ruby/prism/commit/8197be883e
</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>
<entry>
<title>[ruby/prism] Expose main_script in serialization API</title>
<updated>2024-09-13T19:13:21+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-09-13T19:00:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f85efc9748b193bceaefd2e94293927404ac951f'/>
<id>f85efc9748b193bceaefd2e94293927404ac951f</id>
<content type='text'>
https://github.com/ruby/prism/commit/0b527ca93f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/0b527ca93f
</pre>
</div>
</content>
</entry>
<entry>
<title>[PRISM] Only parse shebang on main script</title>
<updated>2024-09-13T16:51:53+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-09-13T15:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9afc6a981deae6e23d938cf5c2c4baadfeaafdb1'/>
<id>9afc6a981deae6e23d938cf5c2c4baadfeaafdb1</id>
<content type='text'>
Fixes [Bug #20730]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #20730]
</pre>
</div>
</content>
</entry>
</feed>
