| Age | Commit message (Collapse) | Author |
|
|
|
https://github.com/ruby/prism/commit/149e2ff7f6
|
|
This allows ... argument forwarding to benefit from Allocationless
Anonymous Splat Forwarding, allowing the `f` call below to not
allocate an array or a hash.
```ruby
a = [1]
kw = {b: 2}
def c(a, b:)
end
def f(...)
c(...)
end
f(*a, **kw)
```
This temporarily skips prism locals tests until prism is changed
to use * and ** for ..., instead of using ruby2_keywords.
Ignore failures in rbs bundled gems tests, since they fail due
to this change.
|
|
https://github.com/ruby/prism/commit/459a9f544e
|
|
https://github.com/ruby/prism/commit/12649ee74c
|
|
otherwise we get failing tests if we have non-ascii
characters in fixtures/**/*.txt
https://github.com/ruby/prism/commit/9323243569
|
|
This simplifies compiling it, since you can now compile the value
as if it were always there.
https://github.com/ruby/prism/commit/bcfc74aacb
|
|
https://github.com/ruby/prism/commit/0a8ff431df
|
|
https://github.com/ruby/prism/commit/ad17f58729
|
|
https://github.com/ruby/prism/commit/4386a4c0da
|
|
https://github.com/ruby/prism/commit/3a216e63fe
|
|
https://github.com/ruby/prism/commit/94ecb366c4
|
|
https://github.com/ruby/prism/commit/24a2872b4e
|
|
https://github.com/ruby/prism/commit/a0c5361b9f
|
|
https://github.com/ruby/prism/commit/8ca24f263e
|
|
Fix https://github.com/ruby/prism/pull/2182
This change reflects this line:
https://github.com/ruby/ruby/blob/6283ae8d369bd2f8a022bb69bc5b742c58529dec/parse.y#L11124.
https://github.com/ruby/prism/commit/a52588ff37
|
|
https://github.com/ruby/prism/commit/6749146c0e
|
|
https://github.com/ruby/prism/commit/d139af033f
|
|
It's possible to repeat parameters in method definitions like so:
```ruby
def foo(_a, _a)
end
```
The compiler needs to know to adjust the local table size to account for
these duplicate names. We'll use the repeated parameter flag to account
for the extra stack space required
https://github.com/ruby/prism/commit/b443cb1f60
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
|
|
https://github.com/ruby/prism/commit/e190308845
|
|
https://github.com/ruby/prism/commit/4d5f43ecbc
|
|
Fix https://github.com/ruby/prism/pull/2094
The part of `parse_variable_call` for variables was split into a new
function `parse_variable` and used it.
https://github.com/ruby/prism/commit/4c5fd1a746
|
|
https://github.com/ruby/prism/commit/75d4331f7f
|
|
https://github.com/ruby/prism/commit/c2d325a886
|
|
https://github.com/ruby/prism/commit/55b049ddac
|
|
Fix https://github.com/ruby/prism/pull/2111
https://github.com/ruby/prism/commit/21ca243d0a
|
|
Because this is a user-facing change, we also need to deal with the
fact that CRuby 3.3.0 was just released.
In order to support workflows that want to parse exactly as CRuby
parses in a specific version, this PR introduces a new option to
the options struct that is "version". This allows you to specify
that you want "3.3.0" parsing.
I'm not sure if this is the correct solution. Another solution is
to just fork and keep around the old branch for security patches.
Or we could keep around a copy of the source files within this
repository as another directory and only update when necessary.
There are a lot of potential solutions here.
Because this change is so small and the check for it is so minimal,
I've decided to go with this enum. If this ends up entirely
cluttering the codebase with version checks, we'll come up with
another solution. But for now this works, so we're going to go in
this direction for a bit until we determine it's no longer working.
https://github.com/ruby/prism/commit/d8c7e6bd10
|
|
This reverts commit d242e8416e99eaee4465e2681210ae8b7ecd6d34.
|
|
We should bundle released version of Prism for Ruby 3.3.0
|
|
String literal hash keys can't be mutated by the user so we should mark
them as frozen. We were seeing instructions for hashes with string
literal keys using two `putstring` instructions when it should be a
`putobject` and `putstring`.
Code example:
```ruby
{ "a" => "b" }
```
Instructions before:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,14)>
0000 putobject "a" ( 2)[Li]
0002 putstring "b"
0004 newhash 2
0006 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,14)>
0000 putstring "a" ( 1)[Li]
0002 putstring "b"
0004 newhash 2
0006 leave
```
Instructions after:
```
"********* Ruby *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,14)>
0000 putobject "a" ( 2)[Li]
0002 putstring "b"
0004 newhash 2
0006 leave
"********* PRISM *************"
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,14)>
0000 putobject "a" ( 1)[Li]
0002 putstring "b"
0004 newhash 2
0006 leave
```
https://github.com/ruby/prism/commit/b14ae55385
|
|
https://github.com/ruby/prism/commit/7f812389f8
|
|
https://github.com/ruby/prism/commit/89bf7a4948
|
|
https://github.com/ruby/prism/commit/3a67b37a56
|
|
Fix https://github.com/ruby/prism/pull/2026
https://github.com/ruby/prism/commit/c4b41cd477
|
|
https://github.com/ruby/prism/commit/ee6fc9ee87
|
|
The previous implementation was incorrect since it was just checking for all keys in assoc nodes to be static literals but the actual check is that all keys in assoc nodes must be symbol nodes.
This commit fixes that implementation, and, also, aliases the flag to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` so that ruby/ruby can start using the new flag name.
I intend to later change the real flag name to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` and remove the alias.
https://github.com/ruby/prism/commit/f5099c79ce
|
|
Fix https://github.com/ruby/prism/pull/2073
https://github.com/ruby/prism/commit/0f747d9240
|
|
https://github.com/ruby/prism/commit/43c4232cfc
|
|
https://github.com/ruby/prism/commit/465731969c
|
|
https://github.com/ruby/prism/commit/0663e2bcfa
|
|
https://github.com/ruby/prism/commit/42a48a2ba9
|
|
https://github.com/ruby/prism/commit/b23136ebfd
|
|
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
|
|
Fix https://github.com/ruby/prism/pull/2034
https://github.com/ruby/prism/commit/8280e577fa
|
|
Fix https://github.com/ruby/prism/pull/2022
Fix https://github.com/ruby/prism/pull/2030
https://github.com/ruby/prism/commit/b78d8b6525
|
|
https://github.com/ruby/prism/commit/a28b427dcc
|
|
This doesn't actually fix the encodings for symbols and regex,
unfortunately. But I wanted to get this change in because it is
the last AST change we're going to make before 3.3 is released.
So, if consumers want, they can start to check these flags to
determine the encoding, even though it will be wrong. Then once we
actually set them correctly, everything should work.
https://github.com/ruby/prism/commit/9b35f7e891
|
|
https://github.com/ruby/prism/commit/1ed07a0c6d
|
|
https://github.com/ruby/prism/commit/d711950d5f
|
|
https://github.com/ruby/prism/commit/e30a241fb3
|