<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/prism/translation/parser/lexer.rb, branch master</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] Fix the handling of `do` on commands</title>
<updated>2026-03-06T18:45:20+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2026-03-06T18:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9ecac8d4690ca4cf4e575bc2fdd31c99aa82e754'/>
<id>9ecac8d4690ca4cf4e575bc2fdd31c99aa82e754</id>
<content type='text'>
Introduce PM_TOKEN_KEYWORD_DO_BLOCK to distinguish do-blocks on
command-style calls from regular `do` keywords. Add
parse_command_do_block to attach these blocks to call nodes. Track
in_endless_def_body to prevent do-block consumption inside endless
method definitions, allowing blocks to correctly bubble up to outer
contexts like `private def f = puts "Hello" do end`.

https://github.com/ruby/prism/commit/7d17fd254b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce PM_TOKEN_KEYWORD_DO_BLOCK to distinguish do-blocks on
command-style calls from regular `do` keywords. Add
parse_command_do_block to attach these blocks to call nodes. Track
in_endless_def_body to prevent do-block consumption inside endless
method definitions, allowing blocks to correctly bubble up to outer
contexts like `private def f = puts "Hello" do end`.

https://github.com/ruby/prism/commit/7d17fd254b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Document fewer useless methods/classes</title>
<updated>2026-02-06T15:42:11+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2026-02-06T15:41:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=545db49ba8063d8e9ed916e508c31523b78d5bb9'/>
<id>545db49ba8063d8e9ed916e508c31523b78d5bb9</id>
<content type='text'>
(https://github.com/ruby/prism/pull/3908)

* Add missing nodocs for FFI

When generating docs in ruby/prism, this doesn't seem to matter.

But on docs.ruby-lang.org these take over the actual documentation.

* Nodoc various utility methods

They don't tell much of a story and just pull attention away from actually unique methods

* Nodoc some private functions/modules

* Nodoc translator implementation details

As well as some functionality from ripper that is nodoc in ruby

* Stop documenting visitor implementation details

These result in so many methods that are searchable
and give no actual benefit.
Toplevel docs are all you need to understand the usecase.

https://github.com/ruby/prism/commit/0bd9a7d373
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/prism/pull/3908)

* Add missing nodocs for FFI

When generating docs in ruby/prism, this doesn't seem to matter.

But on docs.ruby-lang.org these take over the actual documentation.

* Nodoc various utility methods

They don't tell much of a story and just pull attention away from actually unique methods

* Nodoc some private functions/modules

* Nodoc translator implementation details

As well as some functionality from ripper that is nodoc in ruby

* Stop documenting visitor implementation details

These result in so many methods that are searchable
and give no actual benefit.
Toplevel docs are all you need to understand the usecase.

https://github.com/ruby/prism/commit/0bd9a7d373
</pre>
</div>
</content>
</entry>
<entry>
<title>Use slices instead of locations</title>
<updated>2026-01-27T20:30:45+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2026-01-27T02:36:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=af4a1ca021845837fd7bfb1e1b4b5abd7e336c34'/>
<id>af4a1ca021845837fd7bfb1e1b4b5abd7e336c34</id>
<content type='text'>
In the C API, we want to use slices instead of locations in the
AST. In this case a "slice" is effectively the same thing as the
location, expect it is represented using a 32-bit offset and a
32-bit length. This will cut down on half of the space of all of
the locations in the AST.

Note that from the Ruby/Java/JavaScript side, this is effectively
an invisible change. This only impacts the C/Rust side.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the C API, we want to use slices instead of locations in the
AST. In this case a "slice" is effectively the same thing as the
location, expect it is represented using a 32-bit offset and a
32-bit length. This will cut down on half of the space of all of
the locations in the AST.

Note that from the Ruby/Java/JavaScript side, this is effectively
an invisible change. This only impacts the C/Rust side.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Reject some cases with `return` and command calls</title>
<updated>2025-09-11T15:55:55+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-08-29T20:35:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f17405b69cb8b66feed289d9f857c38ce70bfe26'/>
<id>f17405b69cb8b66feed289d9f857c38ce70bfe26</id>
<content type='text'>
The same also applies to `break`/`next`.

https://bugs.ruby-lang.org/issues/21540

https://github.com/ruby/prism/commit/3a38b192e3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The same also applies to `break`/`next`.

https://bugs.ruby-lang.org/issues/21540

https://github.com/ruby/prism/commit/3a38b192e3
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Be more defensive in the parser translator lexer</title>
<updated>2025-08-14T15:42:33+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-08-14T15:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a04555c8ab109355d00275d28d867fce06805c55'/>
<id>a04555c8ab109355d00275d28d867fce06805c55</id>
<content type='text'>
Generally I have been good about safely accessing the tokens but failed
to properly guard against no tokens in places
where it could theoretically happen through invalid syntax.

I added a test case for one occurance, other changes are theoretical only.

https://github.com/ruby/prism/commit/4a3866af19
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generally I have been good about safely accessing the tokens but failed
to properly guard against no tokens in places
where it could theoretically happen through invalid syntax.

I added a test case for one occurance, other changes are theoretical only.

https://github.com/ruby/prism/commit/4a3866af19
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix parser translator with trailing backslash in `%W` /`%I` array</title>
<updated>2025-06-30T12:32:31+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-06-12T12:12:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3071c5d04cb4369ee8118ece30fb2887205f6c61'/>
<id>3071c5d04cb4369ee8118ece30fb2887205f6c61</id>
<content type='text'>
https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#label-25w+and+-25W-3A+String-Array+Literals
&gt; %W allow escape sequences described in Escape Sequences. However the continuation line &lt;newline&gt; is not usable because it is interpreted as the escaped newline described above.

https://github.com/ruby/prism/commit/f5c7460ad5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#label-25w+and+-25W-3A+String-Array+Literals
&gt; %W allow escape sequences described in Escape Sequences. However the continuation line &lt;newline&gt; is not usable because it is interpreted as the escaped newline described above.

https://github.com/ruby/prism/commit/f5c7460ad5
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix parser translator during string escaping with invalid utf-8</title>
<updated>2025-06-11T18:07:43+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-06-11T13:28:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=970813d98285b8f59fe5e4d3c815cc044926cb1b'/>
<id>970813d98285b8f59fe5e4d3c815cc044926cb1b</id>
<content type='text'>
Instead, prefer `scan_byte` over `get_byte` since that already returns the byte as an integer, sidestepping conversion issues.

Fixes https://github.com/ruby/prism/issues/3582

https://github.com/ruby/prism/commit/7f3008b2b5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead, prefer `scan_byte` over `get_byte` since that already returns the byte as an integer, sidestepping conversion issues.

Fixes https://github.com/ruby/prism/issues/3582

https://github.com/ruby/prism/commit/7f3008b2b5
</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] Fix parser translator when pinning hash with string keys</title>
<updated>2025-03-30T17:24:05+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-03-30T10:48:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d7e46543b5fc34487dbc2c784412af015dbe67f4'/>
<id>d7e46543b5fc34487dbc2c784412af015dbe67f4</id>
<content type='text'>
`StringNode` and `SymbolNode` don't have the same shape
(`content` vs `value`) and that wasn't handled.

I believe the logic for the common case can be reused.
I simply left the special handling for implicit nodes in pattern matching
and fall through otherwise.

NOTE: patterns.txt is not actually tested at the moment,
because it contains syntax that `parser` mistakenly rejects.
But I checked manually that this doesn't introduce other failures.
https://github.com/whitequark/parser/pull/1060

https://github.com/ruby/prism/commit/55adfaa895
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`StringNode` and `SymbolNode` don't have the same shape
(`content` vs `value`) and that wasn't handled.

I believe the logic for the common case can be reused.
I simply left the special handling for implicit nodes in pattern matching
and fall through otherwise.

NOTE: patterns.txt is not actually tested at the moment,
because it contains syntax that `parser` mistakenly rejects.
But I checked manually that this doesn't introduce other failures.
https://github.com/whitequark/parser/pull/1060

https://github.com/ruby/prism/commit/55adfaa895
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix up merge conflicts for prism sync</title>
<updated>2025-03-18T17:36:53+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-03-18T17:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b003d4019421e004460a8c947db2695d71ad0b8c'/>
<id>b003d4019421e004460a8c947db2695d71ad0b8c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
