<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/prism/translation/parser/compiler.rb, branch v4.0.4</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] Add equal_loc to call nodes</title>
<updated>2025-10-30T13:06:09+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-10-26T20:16:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8e7d427a721ab715361c577fdea94fdebece6c6d'/>
<id>8e7d427a721ab715361c577fdea94fdebece6c6d</id>
<content type='text'>
In the case of attribute writes, there are use cases where you want
to know the location of the = sign. (Internally we actually need
this for translation to the writequark AST.)

https://github.com/ruby/prism/commit/bfc798a7ec
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case of attribute writes, there are use cases where you want
to know the location of the = sign. (Internally we actually need
this for translation to the writequark AST.)

https://github.com/ruby/prism/commit/bfc798a7ec
</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 parsing rescued exception via indexed assignment</title>
<updated>2025-04-12T17:43:57+00:00</updated>
<author>
<name>viralpraxis</name>
<email>iaroslav2k@gmail.com</email>
</author>
<published>2025-04-10T08:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=543dd77cc39d16a45693d35af670995f7e66ce36'/>
<id>543dd77cc39d16a45693d35af670995f7e66ce36</id>
<content type='text'>
Given this code

```ruby
begin
  raise '42'
rescue =&gt; A[]
end
```

Prism fails with this backtrace

```
Error: test_unparser/corpus/literal/rescue.txt(Prism::ParserTest): NoMethodError: undefined method `arguments' for nil
prism/lib/prism/translation/parser/compiler.rb:1055:in `visit_index_target_node'
prism/lib/prism/node.rb:9636:in `accept'
prism/lib/prism/compiler.rb:30:in `visit'
prism/lib/prism/translation/parser/compiler.rb:218:in `visit_begin_node'
```

Seems like

```diff
-            visit_all(node.arguments.arguments),
+            visit_all(node.arguments&amp;.arguments || []),
```

fixes the problem.

https://github.com/ruby/prism/commit/76d01aeb6c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Given this code

```ruby
begin
  raise '42'
rescue =&gt; A[]
end
```

Prism fails with this backtrace

```
Error: test_unparser/corpus/literal/rescue.txt(Prism::ParserTest): NoMethodError: undefined method `arguments' for nil
prism/lib/prism/translation/parser/compiler.rb:1055:in `visit_index_target_node'
prism/lib/prism/node.rb:9636:in `accept'
prism/lib/prism/compiler.rb:30:in `visit'
prism/lib/prism/translation/parser/compiler.rb:218:in `visit_begin_node'
```

Seems like

```diff
-            visit_all(node.arguments.arguments),
+            visit_all(node.arguments&amp;.arguments || []),
```

fixes the problem.

https://github.com/ruby/prism/commit/76d01aeb6c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix parser translator when splatting in pattern matching pin</title>
<updated>2025-04-02T20:51:54+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-03-30T11:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=334c261cc9ee125c4c4bfc65dec2e571af8944a2'/>
<id>334c261cc9ee125c4c4bfc65dec2e571af8944a2</id>
<content type='text'>
Because it ends up treating it as a local variable, and `a.x`
is not a valid local variable name.

I'm not big on pattern matching, but conceptually it makes sense to me
to treat anything inside ^() to not be
pattern matching syntax?

https://github.com/ruby/prism/commit/80dbd85c45
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because it ends up treating it as a local variable, and `a.x`
is not a valid local variable name.

I'm not big on pattern matching, but conceptually it makes sense to me
to treat anything inside ^() to not be
pattern matching syntax?

https://github.com/ruby/prism/commit/80dbd85c45
</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>[ruby/prism] Accept a newline after the defined? keyword</title>
<updated>2025-03-30T17:22:41+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-03-22T17:17:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=052794bfe1970e90f4f4f9e37fc362dd27903a8d'/>
<id>052794bfe1970e90f4f4f9e37fc362dd27903a8d</id>
<content type='text'>
[Bug #21197]

https://github.com/ruby/prism/commit/22be955ce9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21197]

https://github.com/ruby/prism/commit/22be955ce9
</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>
<entry>
<title>[ruby/prism] Only unnest parser mlhs nodes when no rest argument is provided</title>
<updated>2025-03-18T17:36:53+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-01-20T15:01:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e3c846463092da8a7533740f9960fd626c749305'/>
<id>e3c846463092da8a7533740f9960fd626c749305</id>
<content type='text'>
```
(a,), = []

PARSER====================
s(:masgn,
  s(:mlhs,
    s(:mlhs,
      s(:lvasgn, :a))),
  s(:array))
PRISM====================
s(:masgn,
  s(:mlhs,
    s(:lvasgn, :a)),
  s(:array))
```

https://github.com/ruby/prism/commit/8aa1f4690e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
(a,), = []

PARSER====================
s(:masgn,
  s(:mlhs,
    s(:mlhs,
      s(:lvasgn, :a))),
  s(:array))
PRISM====================
s(:masgn,
  s(:mlhs,
    s(:lvasgn, :a)),
  s(:array))
```

https://github.com/ruby/prism/commit/8aa1f4690e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Fix parser translator multiline interpolated symbols</title>
<updated>2025-03-18T17:36:53+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-01-19T14:54:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=94e12ffa39e46f5b1f80485e9b2e06a59cd69dac'/>
<id>94e12ffa39e46f5b1f80485e9b2e06a59cd69dac</id>
<content type='text'>
In https://github.com/ruby/prism/commit/26370079291a420c6b2b7be5cdbd5c609da62f21 I added tests but didn't modify them correctly

https://github.com/ruby/prism/commit/de021e74de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In https://github.com/ruby/prism/commit/26370079291a420c6b2b7be5cdbd5c609da62f21 I added tests but didn't modify them correctly

https://github.com/ruby/prism/commit/de021e74de
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Further refine string handling in the parser translator</title>
<updated>2025-03-18T17:36:53+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-01-15T22:24:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a8adf5e006da03b8ccaa2bf900f4f077ca9888cf'/>
<id>a8adf5e006da03b8ccaa2bf900f4f077ca9888cf</id>
<content type='text'>
Mostly around newlines and line continuation.
* percent arrays need special backslash handling in the ast
* Fix offset issue for heredocs with many line continuations (used wrong variable as index access)
* More refined rules on when to simplify string tokens
* Handle line continuations in squiggly heredocs
* Correctly dedent squiggly heredocs with interpolation
* Consider `':foo:` and `%s[foo]` to not be interpolation

https://github.com/ruby/prism/commit/4edfe9d981
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly around newlines and line continuation.
* percent arrays need special backslash handling in the ast
* Fix offset issue for heredocs with many line continuations (used wrong variable as index access)
* More refined rules on when to simplify string tokens
* Handle line continuations in squiggly heredocs
* Correctly dedent squiggly heredocs with interpolation
* Consider `':foo:` and `%s[foo]` to not be interpolation

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