| Age | Commit message (Collapse) | Author |
|
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
|
|
This is essentially an adaptation of aae8223c707 ("Dup splat array in
certain cases where there is a block argument") to pass
`TestCall#test_call_block_order`.
This also makes PRISM emit `getblockparamproxy` in cases like
`def foo(&blk) = bar(&blk)` where it used the less efficient
`getblockparam` previously.
Remove the `popped` parameter from setup_args() because it should always
be ignored, and is in fact unused.
|
|
Previously, the local index of numbered parameters were assigned to
names of regular locals, making it hard to read both of them. Use proper
`_[1-9]` numbered parameters. This fixes `test_shapes.rb`.
Also, properly mark the iseq as having lead parameters.
|
|
|
|
Fixes `TestZlibGzipReader#test_gets2`,
`Psych_Unit_Tests#test_spec_explicit_families`, and many failures in
`test_unicode_normalize.rb`.
|
|
Fixes ruby/prism#2321
Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
|
|
|
|
In addition to saving space by deduplicating, this also makes the
literals have code range like TestObjSpace#test_dump_string_coderange
expects. It's testing a detail, but we might as well use rb_fstring().
Note that `putstring` makes a mutable duplicate, so passing it an
fstring is fine.
|
|
There are several prism tests failing related to the `source_location`
for lambda returning line of the operator (`->`)
while original parser execution results in `source_location` line
pointing to the block opening location (`{` or `do`)
This commit changes `PM_LAMBDA_NODE` compilation case
to use block opening location instead of the whole node (operator)
opening location to get the line number to build block iseq
|
|
Previously, `return *array, 1` didn't behave like `return [*array, 1]`
properly. Also, it crashed when splat and kwsplat is combined like in
`array = [*things, **hash]`.
Fix this by grouping `PM_ARGUMENTS_NODE` with `PM_ARRAY_NODE` handling and
combining splat and kwsplat handling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes ruby/prism#2307.
|
|
This copies the changes from 771a2f039b9a059a73e8f111d1d46590fa697f63.
Fixes ruby/prism#2310.
|
|
Before this commit, we were mixing a lot of concerns with the prism
compile between RubyVM::InstructionSequence and the general entry
points to the prism parser/compiler.
This commit makes all of the various prism-related APIs mirror
their corresponding APIs in the existing parser/compiler. This means
we now have the correct frame naming, and it's much easier to follow
where the logic actually flows. Furthermore this consolidates a lot
of the prism initialization, making it easier to see where we could
potentially be raising errors.
|
|
Fixes: https://github.com/ruby/prism/issues/2294
|
|
As this is compiled into only on the recursive call and then added, we
can just use `ret` directly
|
|
|
|
|
|
|
|
Fixes ruby/prism#2295.
|
|
|
|
|
|
Fixes ruby/prism#2290.
|
|
If the first element of an interpolated string node is an embedded
statement, CRuby "pre-initializes" the interpolation with a string of
known encoding to concat into.
This patch replicates thate behaviour in Prism
|
|
|
|
|
|
Fixes ruby/prism#2242.
|
|
Fixes ruby/prism#2272.
|
|
This wasn't taking into account strings with flags set on the containing
node that could affect the encoding. It does now
|
|
|
|
Fixes ruby/prism#2250.
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
|
|
On s390x, a long is 8 bytes. st_data_t is an unsigned long but
pm_constant_id_t is a 4 byte integer. We need to cast it to st_data_t
when passing it to ST functions.
|
|
Fixes ruby/prism#2279.
|
|
|
|
|
|
|
|
Fixes ruby/prism#2248.
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
We need to make sure there is enough room in the local table for
repeated `*_` parameters
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Ensure there is enough space in the local table for repeated optional
parameters.
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
expressions
|