<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/prism/location_test.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Revert all of commits after Prism 0.19.0 release</title>
<updated>2023-12-16T03:08:51+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-12-16T03:05:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d242e8416e99eaee4465e2681210ae8b7ecd6d34'/>
<id>d242e8416e99eaee4465e2681210ae8b7ecd6d34</id>
<content type='text'>
  We should bundle released version of Prism for Ruby 3.3.0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  We should bundle released version of Prism for Ruby 3.3.0
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Invalid pinned locals in pattern matching</title>
<updated>2023-12-15T15:03:49+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-12-15T13:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fe9b42f024eb3724b0853c914916ea7a97fd30a6'/>
<id>fe9b42f024eb3724b0853c914916ea7a97fd30a6</id>
<content type='text'>
https://github.com/ruby/prism/commit/3a67b37a56
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/3a67b37a56
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Split up CallNode in target position</title>
<updated>2023-12-11T15:32:31+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-12-08T14:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b673b5b4329d020b19907142f291c8ecd69e95e0'/>
<id>b673b5b4329d020b19907142f291c8ecd69e95e0</id>
<content type='text'>
In this commit we're splitting up the call nodes that were in target
positions (that is, for loop indices, rescue error captures, and
multi assign targets).

Previously, we would simply leave the call nodes in place. This had
the benefit of keeping the AST relatively simple, but had the
downside of not being very explicit. If a static analysis tool wanted
to only look at call nodes, it could easily be confused because the
method would have 1 fewer argument than it would actually be called
with.

This also brings some consistency to the AST. All of the nodes in
a target position are now *TargetNode nodes. These should all be
treated the same, and the call nodes can now be treated the same.

Finally, there is benefit to memory. Because being in a target
position ensures we don't have some fields, we can strip down the
number of fields on these nodes.

So this commit introduces two new nodes: CallTargetNode and
IndexTargetNode. For CallTargetNode we get to drop the opening_loc,
closing_loc, arguments, and block. Those can never be present. We
also get to mark their fields as non-null, so they will always be
seen as present.

The IndexTargetNode keeps around most of its fields but gets to
drop both the name (because it will always be []=) and the
message_loc (which was always super confusing because it included
the arguments by virtue of being inside the []).

Overall, this adds complexity to the AST at the expense of memory
savings and explicitness. I believe this tradeoff is worth it in
this case, especially because these are very much not common nodes
in the first place.

https://github.com/ruby/prism/commit/3ef71cdb45
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this commit we're splitting up the call nodes that were in target
positions (that is, for loop indices, rescue error captures, and
multi assign targets).

Previously, we would simply leave the call nodes in place. This had
the benefit of keeping the AST relatively simple, but had the
downside of not being very explicit. If a static analysis tool wanted
to only look at call nodes, it could easily be confused because the
method would have 1 fewer argument than it would actually be called
with.

This also brings some consistency to the AST. All of the nodes in
a target position are now *TargetNode nodes. These should all be
treated the same, and the call nodes can now be treated the same.

Finally, there is benefit to memory. Because being in a target
position ensures we don't have some fields, we can strip down the
number of fields on these nodes.

So this commit introduces two new nodes: CallTargetNode and
IndexTargetNode. For CallTargetNode we get to drop the opening_loc,
closing_loc, arguments, and block. Those can never be present. We
also get to mark their fields as non-null, so they will always be
seen as present.

The IndexTargetNode keeps around most of its fields but gets to
drop both the name (because it will always be []=) and the
message_loc (which was always super confusing because it included
the arguments by virtue of being inside the []).

Overall, this adds complexity to the AST at the expense of memory
savings and explicitness. I believe this tradeoff is worth it in
this case, especially because these are very much not common nodes
in the first place.

https://github.com/ruby/prism/commit/3ef71cdb45
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Change numbered parameters</title>
<updated>2023-12-01T17:03:09+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-12-01T01:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cdb74d74afb87a0d7048a53aaf12d32516033a3c'/>
<id>cdb74d74afb87a0d7048a53aaf12d32516033a3c</id>
<content type='text'>
Previously numbered parameters were a field on blocks and lambdas
that indicated the maximum number of numbered parameters in either
the block or lambda, respectively. However they also had a
parameters field that would always be nil in these cases.

This changes it so that we introduce a NumberedParametersNode that
goes in place of parameters, which has a single uint8_t maximum
field on it. That field contains the maximum numbered parameter in
either the block or lambda.

As a part of the PR, I'm introducing a new UInt8Field type that
can be used on nodes, which is just to make it a little more
explicit what the maximum values can be (the maximum is actually 9,
since it only goes up to _9). Plus we can do a couple of nice
things in serialization like just read a single byte.

https://github.com/ruby/prism/commit/2d87303903
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously numbered parameters were a field on blocks and lambdas
that indicated the maximum number of numbered parameters in either
the block or lambda, respectively. However they also had a
parameters field that would always be nil in these cases.

This changes it so that we introduce a NumberedParametersNode that
goes in place of parameters, which has a single uint8_t maximum
field on it. That field contains the maximum numbered parameter in
either the block or lambda.

As a part of the PR, I'm introducing a new UInt8Field type that
can be used on nodes, which is just to make it a little more
explicit what the maximum values can be (the maximum is actually 9,
since it only goes up to _9). Plus we can do a couple of nice
things in serialization like just read a single byte.

https://github.com/ruby/prism/commit/2d87303903
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Implicit rest nodes</title>
<updated>2023-11-28T22:33:50+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-11-28T20:49:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=49383901772f874569bbdc992867bd02b4b597a8'/>
<id>49383901772f874569bbdc992867bd02b4b597a8</id>
<content type='text'>
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }`
because of arity checks. This PR introduces a new node to handle
that, `ImplicitRestNode`, which goes in the `rest` slot of parameter
nodes instead of `RestParameterNode` instances.

This is also used in a couple of other places, namely:

* pattern matching: `foo in [bar,]`
* multi target: `for foo, in bar do end`
* multi write: `foo, = bar`

Now the only splat nodes with a `NULL` value are when you're
forwarding, as in: `def foo(*) = bar(*)`.

https://github.com/ruby/prism/commit/dba2a3b652
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }`
because of arity checks. This PR introduces a new node to handle
that, `ImplicitRestNode`, which goes in the `rest` slot of parameter
nodes instead of `RestParameterNode` instances.

This is also used in a couple of other places, namely:

* pattern matching: `foo in [bar,]`
* multi target: `for foo, in bar do end`
* multi write: `foo, = bar`

Now the only splat nodes with a `NULL` value are when you're
forwarding, as in: `def foo(*) = bar(*)`.

https://github.com/ruby/prism/commit/dba2a3b652
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Remove string concat in favor of a flat list</title>
<updated>2023-11-21T16:35:46+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-11-10T04:50:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ddacc0852895adfe3ffec83cdb79ba21f6db169f'/>
<id>ddacc0852895adfe3ffec83cdb79ba21f6db169f</id>
<content type='text'>
Right now when you have a lot of string concats it ends up being
difficult to work with because of the depth of the tree. You end
up descending very far for every string literal that is part of the
concat.

There are already times when we use an interpolated string node to
group together two string segments that are part of the same string
(like when they are interupted by the contents of a heredoc). This
commit takes the same approach and replaces string concats with
interpolated string nodes.

Now that they're a flat list, they should be much easier to work
with. There's still some missing information here that would be
useful to consumers: whether or not there is _actually_ any
interpolation contained in the list. We could remedy this with
another node type that is named something like string list, or we
could add a flag to interpolated string node indicating that there
is interpolation. Either way I want to solve that in a follow-up
commit, since this commit is valuable on its own.

https://github.com/ruby/prism/commit/1e7ae3ad1b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Right now when you have a lot of string concats it ends up being
difficult to work with because of the depth of the tree. You end
up descending very far for every string literal that is part of the
concat.

There are already times when we use an interpolated string node to
group together two string segments that are part of the same string
(like when they are interupted by the contents of a heredoc). This
commit takes the same approach and replaces string concats with
interpolated string nodes.

Now that they're a flat list, they should be much easier to work
with. There's still some missing information here that would be
useful to consumers: whether or not there is _actually_ any
interpolation contained in the list. We could remedy this with
another node type that is named something like string list, or we
could add a flag to interpolated string node indicating that there
is interpolation. Either way I want to solve that in a follow-up
commit, since this commit is valuable on its own.

https://github.com/ruby/prism/commit/1e7ae3ad1b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Split up CaseNode and CaseMatchNode</title>
<updated>2023-11-21T02:38:07+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-11-21T02:38:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9fa524dd41be60654e8515f9e406f6f47f0ac7fa'/>
<id>9fa524dd41be60654e8515f9e406f6f47f0ac7fa</id>
<content type='text'>
(https://github.com/ruby/prism/pull/1801)

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

https://github.com/ruby/prism/commit/4c1391ea56
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Flip incorrect names of OptionalKeywordParameterNode and RequiredKeywordParameterNode</title>
<updated>2023-11-01T14:40:45+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2023-11-01T12:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e80ca70b9bd1ccfa319790475dc9c0dd125f4f0d'/>
<id>e80ca70b9bd1ccfa319790475dc9c0dd125f4f0d</id>
<content type='text'>
https://github.com/ruby/prism/commit/c31f61e898
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/c31f61e898
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Split KeywordParameterNode into Optional and Required</title>
<updated>2023-11-01T14:40:44+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2023-10-31T20:00:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0625099e0f691f44fb4c796d8d497d818bf7c8e'/>
<id>d0625099e0f691f44fb4c796d8d497d818bf7c8e</id>
<content type='text'>
Prior to this commit, KeywordParameterNode included both optional
and required keywords. With this commit, it is split in two, with
`OptionalKeywordParameterNode`s no longer having a value field.

https://github.com/ruby/prism/commit/89084d9af4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prior to this commit, KeywordParameterNode included both optional
and required keywords. With this commit, it is split in two, with
`OptionalKeywordParameterNode`s no longer having a value field.

https://github.com/ruby/prism/commit/89084d9af4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/prism] Rename to lefts/rights</title>
<updated>2023-10-26T18:59:13+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2023-10-26T18:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=018f0a9c5fda185f91edf3da797b9e1b1df14706'/>
<id>018f0a9c5fda185f91edf3da797b9e1b1df14706</id>
<content type='text'>
https://github.com/ruby/prism/commit/e6deed05a5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/prism/commit/e6deed05a5
</pre>
</div>
</content>
</entry>
</feed>
