<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/prism/ruby/parser_test.rb, 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 to v1.5.2</title>
<updated>2025-12-08T23:30:35+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-08T22:56:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d282e76fb6c9f56ac44b3abfc8a3fc9f10edd6f0'/>
<id>d282e76fb6c9f56ac44b3abfc8a3fc9f10edd6f0</id>
<content type='text'>
[Backport #21187]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Backport #21187]
</pre>
</div>
</content>
</entry>
<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] 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] (parser) Print when token tests are now passing</title>
<updated>2024-06-19T01:18:39+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-12T13:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dfb67a44338e5c17d53be3f65e1fb5ccb33367d0'/>
<id>dfb67a44338e5c17d53be3f65e1fb5ccb33367d0</id>
<content type='text'>
https://github.com/ruby/prism/commit/9e4fb665ee
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/9e4fb665ee
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] (parser) Fix up tokens for empty symbol</title>
<updated>2024-06-19T01:18:39+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-12T13:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=24f48382bc3ab62ca0979f1a6879f0d82134abfe'/>
<id>24f48382bc3ab62ca0979f1a6879f0d82134abfe</id>
<content type='text'>
https://github.com/ruby/prism/commit/5985ab7687
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/5985ab7687
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Provide ability to lock encoding while parsing</title>
<updated>2024-06-10T21:21:32+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-10T17:39:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d827d3252786a5e1153f4e8bfa30f40a2aaafb95'/>
<id>d827d3252786a5e1153f4e8bfa30f40a2aaafb95</id>
<content type='text'>
https://github.com/ruby/prism/commit/f7faedfb3f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/f7faedfb3f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Handle chomped bytesize with lines without newlines</title>
<updated>2024-06-07T19:46:27+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-07T19:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=41a36b68531dd1d9fa044c34ac40a5c4abedda2e'/>
<id>41a36b68531dd1d9fa044c34ac40a5c4abedda2e</id>
<content type='text'>
https://github.com/ruby/prism/commit/1528d3c019
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/1528d3c019
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Document that nested heredocs are not properly parsed for parser</title>
<updated>2024-06-07T19:46:24+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2024-06-07T18:55:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=94e059797ae89b35a2c72bf1a4307766a1a9e960'/>
<id>94e059797ae89b35a2c72bf1a4307766a1a9e960</id>
<content type='text'>
https://github.com/ruby/prism/commit/d218e65561
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/d218e65561
</pre>
</div>
</content>
</entry>
</feed>
