<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/prism/translation/parser, 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>[ruby/prism] Accept a newline after the defined? keyword [Backport #21197] (#13327)</title>
<updated>2025-07-09T21:51:32+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-07-09T21:51:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1e3d24a0f47e142270bfb6073feb77f6364af052'/>
<id>1e3d24a0f47e142270bfb6073feb77f6364af052</id>
<content type='text'>
* [ruby/prism] Accept a newline after the defined? keyword

[Bug #21197]

https://github.com/ruby/prism/commit/22be955ce9

* Fix a compilation error

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;

---------

Co-authored-by: Kevin Newton &lt;kddnewton@gmail.com&gt;
Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* [ruby/prism] Accept a newline after the defined? keyword

[Bug #21197]

https://github.com/ruby/prism/commit/22be955ce9

* Fix a compilation error

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;

---------

Co-authored-by: Kevin Newton &lt;kddnewton@gmail.com&gt;
Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "merge revision(s) 052794bfe1970e90f4f4f9e37fc362dd27903a8d: [Backport #21197]"</title>
<updated>2025-04-14T07:29:03+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-04-14T07:29:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1c23c3095325a4ade2064cc3b35ce8e678e03ebf'/>
<id>1c23c3095325a4ade2064cc3b35ce8e678e03ebf</id>
<content type='text'>
This reverts commit e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 052794bfe1970e90f4f4f9e37fc362dd27903a8d: [Backport #21197]</title>
<updated>2025-04-14T07:18:37+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-04-14T07:18:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f'/>
<id>e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f</id>
<content type='text'>
	[ruby/prism] Accept a newline after the defined? keyword

	[Bug #21197]

	https://github.com/ruby/prism/commit/22be955ce9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[ruby/prism] Accept a newline after the defined? keyword

	[Bug #21197]

	https://github.com/ruby/prism/commit/22be955ce9
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Simplify srange_find in parser compiler</title>
<updated>2024-12-16T15:51:22+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-11-04T16:07:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2ab1b07b84a9f2947f52b8b7bb758eb00a51b47f'/>
<id>2ab1b07b84a9f2947f52b8b7bb758eb00a51b47f</id>
<content type='text'>
https://github.com/ruby/prism/commit/34efacc618
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/34efacc618
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Add do keyword tracking for While/Until</title>
<updated>2024-12-16T15:51:22+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-11-04T15:53:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cc967a470b65b3fe4bae00d930a42e213eca6687'/>
<id>cc967a470b65b3fe4bae00d930a42e213eca6687</id>
<content type='text'>
https://github.com/ruby/prism/commit/9686897290
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/9686897290
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix `kDO_LAMBDA` token incompatibility for `Prism::Translation::Parser::Lexer`</title>
<updated>2024-09-20T17:17:21+00:00</updated>
<author>
<name>Koichi ITO</name>
<email>koic.ito@gmail.com</email>
</author>
<published>2024-09-10T03:22:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=75ed086348da66e4cfe9488ae9ece5462dd2aef9'/>
<id>75ed086348da66e4cfe9488ae9ece5462dd2aef9</id>
<content type='text'>
## Summary

This PR fixes `kDO_LAMBDA` token incompatibility between Parser gem and `Prism::Translation::Parser` for lambda `do` block.

### Parser gem (Expected)

Returns `kDO_LAMBDA` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

### `Prism::Translation::Parser` (Actual)

Previously, the parser returned `kDO` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

After the update, the parser now returns `kDO_LAMBDA` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

## Additional Information

Unfortunately, this kind of edge case doesn't work as expected; `kDO` is returned instead of `kDO_LAMBDA`.
However, since `kDO` is already being returned in this case, there is no change in behavior.

### Parser gem

Returns `tLAMBDA` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; (foo = -&gt; (bar) {}) do end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 4...7&gt;]], [:tEQL, ["=", #&lt;Parser::Source::Range example.rb 8...9&gt;]],
[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 10...12&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 13...14&gt;]],
[:tIDENTIFIER, ["bar", #&lt;Parser::Source::Range example.rb 14...17&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 17...18&gt;]],
[:tLAMBEG, ["{", #&lt;Parser::Source::Range example.rb 19...20&gt;]], [:tRCURLY, ["}", #&lt;Parser::Source::Range example.rb 20...21&gt;]],
[:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 21...22&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 23...25&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 26...29&gt;]]]
```

### `Prism::Translation::Parser`

Returns `kDO` token:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; (foo = -&gt; (bar) {}) do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 4...7&gt;]], [:tEQL, ["=", #&lt;Parser::Source::Range example.rb 8...9&gt;]],
[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 10...12&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 13...14&gt;]],
[:tIDENTIFIER, ["bar", #&lt;Parser::Source::Range example.rb 14...17&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 17...18&gt;]],
[:tLAMBEG, ["{", #&lt;Parser::Source::Range example.rb 19...20&gt;]], [:tRCURLY, ["}", #&lt;Parser::Source::Range example.rb 20...21&gt;]],
[:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 21...22&gt;]], [:kDO, ["do", #&lt;Parser::Source::Range example.rb 23...25&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 26...29&gt;]]]
```

As the intention is not to address such special cases at this point, a comment has been left indicating that this case still returns `kDO`.
In other words, `kDO_LAMBDA` will now be returned except for edge cases after this PR.

https://github.com/ruby/prism/commit/2ee480654c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
## Summary

This PR fixes `kDO_LAMBDA` token incompatibility between Parser gem and `Prism::Translation::Parser` for lambda `do` block.

### Parser gem (Expected)

Returns `kDO_LAMBDA` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

### `Prism::Translation::Parser` (Actual)

Previously, the parser returned `kDO` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

After the update, the parser now returns `kDO_LAMBDA` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 3...5&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 6...9&gt;]]]
```

## Additional Information

Unfortunately, this kind of edge case doesn't work as expected; `kDO` is returned instead of `kDO_LAMBDA`.
However, since `kDO` is already being returned in this case, there is no change in behavior.

### Parser gem

Returns `tLAMBDA` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; (foo = -&gt; (bar) {}) do end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 4...7&gt;]], [:tEQL, ["=", #&lt;Parser::Source::Range example.rb 8...9&gt;]],
[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 10...12&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 13...14&gt;]],
[:tIDENTIFIER, ["bar", #&lt;Parser::Source::Range example.rb 14...17&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 17...18&gt;]],
[:tLAMBEG, ["{", #&lt;Parser::Source::Range example.rb 19...20&gt;]], [:tRCURLY, ["}", #&lt;Parser::Source::Range example.rb 20...21&gt;]],
[:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 21...22&gt;]], [:kDO_LAMBDA, ["do", #&lt;Parser::Source::Range example.rb 23...25&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 26...29&gt;]]]
```

### `Prism::Translation::Parser`

Returns `kDO` token:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-&gt; (foo = -&gt; (bar) {}) do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23]
[[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 0...2&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 4...7&gt;]], [:tEQL, ["=", #&lt;Parser::Source::Range example.rb 8...9&gt;]],
[:tLAMBDA, ["-&gt;", #&lt;Parser::Source::Range example.rb 10...12&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 13...14&gt;]],
[:tIDENTIFIER, ["bar", #&lt;Parser::Source::Range example.rb 14...17&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 17...18&gt;]],
[:tLAMBEG, ["{", #&lt;Parser::Source::Range example.rb 19...20&gt;]], [:tRCURLY, ["}", #&lt;Parser::Source::Range example.rb 20...21&gt;]],
[:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 21...22&gt;]], [:kDO, ["do", #&lt;Parser::Source::Range example.rb 23...25&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 26...29&gt;]]]
```

As the intention is not to address such special cases at this point, a comment has been left indicating that this case still returns `kDO`.
In other words, `kDO_LAMBDA` will now be returned except for edge cases after this PR.

https://github.com/ruby/prism/commit/2ee480654c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`</title>
<updated>2024-09-09T19:01:30+00:00</updated>
<author>
<name>Koichi ITO</name>
<email>koic.ito@gmail.com</email>
</author>
<published>2024-09-08T09:25:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7a6533452807aa432f097db4e637e4c480645d6b'/>
<id>7a6533452807aa432f097db4e637e4c480645d6b</id>
<content type='text'>
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for double splat argument.

## Parser gem (Expected)

Returns `tDSTAR` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tDSTAR, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

## `Prism::Translation::Parser` (Actual)

Previously, the parser returned `tPOW` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tPOW, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

After the update, the parser now returns `tDSTAR` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tDSTAR, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

With this change, the following code could be removed from test/prism/ruby/parser_test.rb:

```diff
-          when :tPOW
-            actual_token[0] = expected_token[0] if expected_token[0] == :tDSTAR
```

`tPOW` is the token type for the behavior of `a ** b`, and its behavior remains unchanged:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "a ** b"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["a", #&lt;Parser::Source::Range example.rb 0...1&gt;]], [:tPOW, ["**", #&lt;Parser::Source::Range example.rb 2...4&gt;]],
[:tIDENTIFIER, ["b", #&lt;Parser::Source::Range example.rb 5...6&gt;]]]
```

https://github.com/ruby/prism/commit/66bde35a44
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for double splat argument.

## Parser gem (Expected)

Returns `tDSTAR` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tDSTAR, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

## `Prism::Translation::Parser` (Actual)

Previously, the parser returned `tPOW` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tPOW, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

After the update, the parser now returns `tDSTAR` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:kDEF, ["def", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tIDENTIFIER, ["f", #&lt;Parser::Source::Range example.rb 4...5&gt;]],
[:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 5...6&gt;]], [:tDSTAR, ["**", #&lt;Parser::Source::Range example.rb 6...8&gt;]],
[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 8...11&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 11...12&gt;]],
[:kEND, ["end", #&lt;Parser::Source::Range example.rb 13...16&gt;]]]
```

With this change, the following code could be removed from test/prism/ruby/parser_test.rb:

```diff
-          when :tPOW
-            actual_token[0] = expected_token[0] if expected_token[0] == :tDSTAR
```

`tPOW` is the token type for the behavior of `a ** b`, and its behavior remains unchanged:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "a ** b"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["a", #&lt;Parser::Source::Range example.rb 0...1&gt;]], [:tPOW, ["**", #&lt;Parser::Source::Range example.rb 2...4&gt;]],
[:tIDENTIFIER, ["b", #&lt;Parser::Source::Range example.rb 5...6&gt;]]]
```

https://github.com/ruby/prism/commit/66bde35a44
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`</title>
<updated>2024-09-07T22:36:38+00:00</updated>
<author>
<name>Koichi ITO</name>
<email>koic.ito@gmail.com</email>
</author>
<published>2024-09-07T14:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=47742841246c637053dc8dad447c7e5e28182676'/>
<id>47742841246c637053dc8dad447c7e5e28182676</id>
<content type='text'>
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis.

## Parser gem (Expected)

Returns `tLPAREN2` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 \
-ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

## `Prism::Translation::Parser` (Actual)

Previously, the parser returned `tLPAREN` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

After the update, the parser now returns `tLPAREN2` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem.
The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`.

With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`:

```diff
-          when :tLPAREN
-            actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2
```

https://github.com/ruby/prism/commit/04d6f3478d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis.

## Parser gem (Expected)

Returns `tLPAREN2` token:

```console
$ bundle exec ruby -Ilib -rparser/ruby33 \
-ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

## `Prism::Translation::Parser` (Actual)

Previously, the parser returned `tLPAREN` token when parsing the following:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

After the update, the parser now returns `tLPAREN2` token for the same input:

```console
$ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \
'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]'
ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23]
[[:tIDENTIFIER, ["foo", #&lt;Parser::Source::Range example.rb 0...3&gt;]], [:tLPAREN2, ["(", #&lt;Parser::Source::Range example.rb 3...4&gt;]],
[:tSYMBOL, ["bar", #&lt;Parser::Source::Range example.rb 4...8&gt;]], [:tRPAREN, [")", #&lt;Parser::Source::Range example.rb 8...9&gt;]]]
```

The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem.
The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`.

With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`:

```diff
-          when :tLPAREN
-            actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2
```

https://github.com/ruby/prism/commit/04d6f3478d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Remove deprecated lib/prism/translation/parser/rubocop.rb file</title>
<updated>2024-08-29T20:04:55+00:00</updated>
<author>
<name>Koichi ITO</name>
<email>koic.ito@gmail.com</email>
</author>
<published>2024-08-20T17:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=af65b41e07091c31603b7012941f1edc20d042e7'/>
<id>af65b41e07091c31603b7012941f1edc20d042e7</id>
<content type='text'>
Follow up https://github.com/ruby/prism/pull/2558.

This PR removes deprecated lib/prism/translation/parser/rubocop.rb file.

The file was a workaround to allow setting `TargetRubyVersion: 80_82_73_83_77.xx` until Prism (`Prism::Translation::Parser`) is integrated into RuboCop.
RuboCop already supports Prism (`Prism::Translation::Parser`) as of https://github.com/rubocop/rubocop/pull/12724.

It has been several months since the file was deprecated in ruby/prism#2558.
And, yesterday, Prism 1.0.0 was released, but perhaps the file should have been removed before then.

Although this might be seen as incompatible with semver 1.0.0, I think there is no longer a reason to keep the file.

https://github.com/ruby/prism/commit/646a10270e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up https://github.com/ruby/prism/pull/2558.

This PR removes deprecated lib/prism/translation/parser/rubocop.rb file.

The file was a workaround to allow setting `TargetRubyVersion: 80_82_73_83_77.xx` until Prism (`Prism::Translation::Parser`) is integrated into RuboCop.
RuboCop already supports Prism (`Prism::Translation::Parser`) as of https://github.com/rubocop/rubocop/pull/12724.

It has been several months since the file was deprecated in ruby/prism#2558.
And, yesterday, Prism 1.0.0 was released, but perhaps the file should have been removed before then.

Although this might be seen as incompatible with semver 1.0.0, I think there is no longer a reason to keep the file.

https://github.com/ruby/prism/commit/646a10270e
</pre>
</div>
</content>
</entry>
</feed>
