Граф коммитов

561 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton 0cf00ca7aa [PRISM] Remove specialized macros that used dummy_line_node 2024-04-04 14:14:55 -04:00
Kevin Newton b360b4ce3e [PRISM] Remove dummy_line_node usage from get/set local instructions 2024-04-04 14:14:55 -04:00
Kevin Newton cb5dbca82e [PRISM] Remove dummy_line_node usage from remaining nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 8bf368d183 [PRISM] Remove dummy_line_node usage from ensure and flip flop nodes 2024-04-04 14:14:55 -04:00
Kevin Newton cc248706dd [PRISM] Remove dummy_line_node usage from false and else node 2024-04-04 14:14:55 -04:00
Kevin Newton 829ca8c4e3 [PRISM] Remove dummy_line_node usage from embedded nodes 2024-04-04 14:14:55 -04:00
Kevin Newton ca5ad4dac7 [PRISM] Remove dummy_line_node usage from class nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 2e408d3077 [PRISM] Remove dummy_line_node usage from case nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 2d523c27cf [PRISM] Remove dummy_line_node usage from defined expressions 2024-04-04 14:14:55 -04:00
Kevin Newton 3410387096 [PRISM] Remove dummy_line_node usage from constant nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 3cc61dc9ba [PRISM] Remove dummy_line_node usage from class variable nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 116a332c3a [PRISM] Remove dummy_line_node usage from global variable nodes 2024-04-04 14:14:55 -04:00
Kevin Newton bc5a520eca [PRISM] Remove dummy_line_node usage from index nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 6bec2a5333 [PRISM] Remove dummy_line_node usage from instance variable nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 5be0357847 [PRISM] Remove dummy_line_node usage from keyword hash and lambda nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 98823b5091 [PRISM] Remove dummy_line_node usage from local variable nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 0782fc4a2a [PRISM] Remove dummy_line_node usage from match predicate node 2024-04-04 14:14:55 -04:00
Kevin Newton 95ad2b0a62 [PRISM] Remove dummy_line_node usage from match required node 2024-04-04 14:14:55 -04:00
Kevin Newton c9f80021e2 [PRISM] Simplify match write node compilation 2024-04-04 14:14:55 -04:00
Kevin Newton 69ec4990d8 [PRISM] Remove dummy_line_node usage from module and match write node 2024-04-04 14:14:55 -04:00
Kevin Newton 449384f337 [PRISM] Remove dummy_line_node usage for multi write node 2024-04-04 14:14:55 -04:00
Kevin Newton 5e8546e8a9 [PRISM] Remove dummy_line_node usage for next node 2024-04-04 14:14:55 -04:00
Kevin Newton 24f9faf67c [PRISM] Remove dummy_line_node usage for call operator write node 2024-04-04 14:14:55 -04:00
Kevin Newton 4d347a0a55 [PRISM] Remove dummy_line_node usage for call and/or write node 2024-04-04 14:14:55 -04:00
Kevin Newton 91373bd64d [PRISM] Remove dummy_line_node usage for call nodes 2024-04-04 14:14:55 -04:00
Kevin Newton eb3bad1a0f [PRISM] Remove dummy_line_node usage for break nodes 2024-04-04 14:14:55 -04:00
Kevin Newton ffd9402c8d [PRISM] Remove dummy_line_node usage for block argument nodes 2024-04-04 14:14:55 -04:00
Kevin Newton c15c611ea5 [PRISM] Remove dummy_line_node usage for begin nodes 2024-04-04 14:14:55 -04:00
Kevin Newton 59f931e4f7 [PRISM] Remove dummy_line_node usage for PM_BACK_REFERENCE_READ_NODE 2024-04-04 14:14:55 -04:00
Kevin Newton 6c1cf5232f [PRISM] Remove dummy_line_node usage in pm_interpolated_node_compile 2024-04-04 14:14:55 -04:00
Kevin Newton ced6aff206 [PRISM] Mark constant path owning expressions as not popped 2024-04-03 17:34:12 -04:00
Kevin Newton 8191735b73 [PRISM] Fix BEGIN{} execution order 2024-03-29 08:51:04 -04:00
Kevin Newton a8f902ea8e [PRISM] Add debug info for frozen strings 2024-03-28 15:17:29 -04:00
Kevin Newton 86e0d83a32 [PRISM] Simplify raising load errors 2024-03-28 12:04:35 -04:00
Kevin Newton f7c5e11d89 [PRISM] Use new -x prism API 2024-03-28 12:04:35 -04:00
Kevin Newton 7e12b03c5a [PRISM] Set path on syntax error 2024-03-27 17:19:24 -04:00
Kevin Newton 39606f36e3 [PRISM] Implicitly change encoding when a UTF-8 BOM is found 2024-03-27 14:19:58 -04:00
Kevin Newton ab2ee308aa [PRISM] Match style for invalid encoding error 2024-03-27 14:19:58 -04:00
Kevin Newton eb995a6410 [PRISM] Include file and line in error message 2024-03-27 14:19:58 -04:00
Kevin Newton a69f0047cb [PRISM] Use new error formatting API 2024-03-27 13:03:11 -04:00
Kevin Newton 42d1cd8f7f [PRISM] Pass --enable-frozen-string-literal through to evals 2024-03-27 08:34:42 -04:00
Kevin Newton e4b2109065 [PRISM] Fix ASCII-compatible check for eval encoding 2024-03-27 08:34:42 -04:00
Kevin Newton 0c62eb25b5 [PRISM] Use correct encoding for regular expression literals 2024-03-26 15:32:09 -04:00
Kevin Newton 4300c42a7e [PRISM] Better handle interpolated* nodes with inner frozen parts 2024-03-26 12:11:09 -04:00
Étienne Barrié 12be40ae6b Implement chilled strings
[Feature #20205]

As a path toward enabling frozen string literals by default in the future,
this commit introduce "chilled strings". From a user perspective chilled
strings pretend to be frozen, but on the first attempt to mutate them,
they lose their frozen status and emit a warning rather than to raise a
`FrozenError`.

Implementation wise, `rb_compile_option_struct.frozen_string_literal` is
no longer a boolean but a tri-state of `enabled/disabled/unset`.

When code is compiled with frozen string literals neither explictly enabled
or disabled, string literals are compiled with a new `putchilledstring`
instruction. This instruction is identical to `putstring` except it marks
the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags.

Chilled strings have the `FL_FREEZE` flag as to minimize the need to check
for chilled strings across the codebase, and to improve compatibility with
C extensions.

Notes:
  - `String#freeze`: clears the chilled flag.
  - `String#-@`: acts as if the string was mutable.
  - `String#+@`: acts as if the string was mutable.
  - `String#clone`: copies the chilled flag.

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-19 09:26:49 +01:00
Kevin Newton b7ca4b1e2d [PRISM] Fix up frozen checks for aref 2024-03-18 11:55:43 -04:00
Jean Boussier 91bf7eb274 Refactor frozen_string_literal check during compilation
In preparation for https://bugs.ruby-lang.org/issues/20205.

The `frozen_string_literal` compilation option will no longer
be a boolean but a tri-state: `on/off/default`.
2024-03-15 15:52:33 +01:00
Kevin Newton b4f3f3c103
[PRISM] Fix up source file when not frozen 2024-03-15 09:47:49 -04:00
Kevin Newton 043c90e161
Fix compiling shareable constant nodes 2024-03-15 09:42:44 -04:00
Kevin Newton 1e7c0fcc9a [PRISM] Fix float in case dispatch 2024-03-14 21:59:26 -04:00
Jean Boussier 09d8c99cdc Ensure test suite is compatible with --frozen-string-literal
As preparation for https://bugs.ruby-lang.org/issues/20205
making sure the test suite is compatible with frozen string
literals is making things easier.
2024-03-14 17:56:15 +01:00
Kevin Newton 2f8cbd6431 [PRISM] Handle ambiguous_param0 for it and numbered parameters 2024-03-13 19:01:33 -04:00
Kevin Newton 7c9e6eab89 Handle nth ref too big 2024-03-13 19:01:21 -04:00
Kevin Newton fa009e392c [PRISM] Static literal strings should be fstrings 2024-03-13 14:24:53 -04:00
Kevin Newton e6a1baad48 [PRISM] Fix compiling duplicated keywords 2024-03-13 14:13:19 -04:00
Kevin Newton 22217e70c2
[PRISM] Handle parentheses in patterns in prism 2024-03-13 10:06:19 -04:00
Kevin Newton a6dac9bb4f [PRISM] Parse stdin on CLI with prism 2024-03-11 12:51:32 -04:00
Kevin Newton 811296b4af [PRISM] Use new integer logic 2024-03-07 18:02:33 -05:00
cui fliter 226a889dc7
[DOC] fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 18:50:47 +09:00
Kevin Newton a29c0e827f [PRISM] Handle implicit flip-flop bounds checking against $. 2024-02-28 13:26:00 -05:00
Kevin Newton 16c7144cd5 [PRISM] Only look up encoding once per file 2024-02-28 12:44:24 -05:00
Kevin Newton f8355e88d6 [PRISM] Do not load -r until we check if main script can be read 2024-02-28 12:42:57 -05:00
Kevin Newton 4016535404 [PRISM] Integrate new number parsing 2024-02-22 22:42:44 -05:00
Kevin Newton be96dc9f8c [PRISM] Support it local variable 2024-02-21 17:55:11 -05:00
Kevin Newton 5c02d97780 [PRISM] Remove more dummy line usage
* or
* optional parameter
* parentheses
* pre execution
* post execution
* range
* rational
* redo
2024-02-21 14:14:21 -05:00
Kevin Newton e19fde52cc [PRISM] Remove more dummy line usage
* if
* unless
2024-02-21 14:14:21 -05:00
Kevin Newton e1f6b477e0 [PRISM] Remove more dummy line usage
* regular expressions
* rescue
* rescue modifier
2024-02-21 14:14:21 -05:00
Kevin Newton e7d480df5d [PRISM] Remove more dummy line usage
* returns
* retry
* self
* singleton class
2024-02-21 14:14:21 -05:00
Kevin Newton 61c5936da3 [PRISM] Remove more dummy line usage
* source files
* source encodings
* source lines
2024-02-21 14:14:21 -05:00
Kevin Newton 220ced7486 [PRISM] Remove more dummy line usage
* yields
* xstrings
* while
* until
* undef
* true
* symbol
* super
* string
* statements
* splat
2024-02-21 14:14:21 -05:00
Peter Zhu 777c4da0bf [PRISM] GC guard strings
Using RSTRING_PTR can cause the string object to not exist on the stack,
which could cause it to be GC'd or be moved by GC compaction. This can
cause RSTRING_PTR to point to the incorrect location if the string is
embedded and moved by GC compaction.

Fixes ruby/prism#2442.
2024-02-16 15:02:03 -05:00
Kevin Newton 9933377c34 [PRISM] Correctly hook up line numbers for eval 2024-02-14 15:29:26 -05:00
Kevin Newton fc2c128e7e [PRISM] Set eval encoding based on string encoding 2024-02-14 13:24:43 -05:00
Matt Valentine-House f70a4a0336 [PRISM] yield is invalid inside eval 2024-02-13 21:19:12 -05:00
Matt Valentine-House 0285b533e9 [PRISM] Don't rb_bug if redo/break/next used during eval 2024-02-13 21:19:12 -05:00
Peter Zhu a5869e5d8c [PRISM] Replace assert with RUBY_ASSERT
assert does not print the bug report, only the file and line number of
the assertion that failed. RUBY_ASSERT prints the full bug report, which
makes it much easier to debug.
2024-02-13 15:54:04 -05:00
Peter Zhu 83c158fdfc [PRISM] Replace assert with rb_bug 2024-02-13 15:54:04 -05:00
Kevin Newton 4e481c772e [PRISM] Refactors to use more locations 2024-02-13 10:26:42 -05:00
Kevin Newton fe31b682be [PRISM] Stop passing parser around so much 2024-02-13 10:26:42 -05:00
Kevin Newton e967e06276 [PRISM] Switch to locations for PM_ALIAS_GLOBAL_VARIABLE_NODE, PM_ALIAS_METHOD_NODE, and PM_AND_NODE 2024-02-13 10:26:42 -05:00
Kevin Newton 76ab017f01 [PRISM] Brace style in prism_compile.c 2024-02-13 10:26:42 -05:00
Nikita Vasilevsky d357d50f0a [PRISM] Fix lambda start column number
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-13 09:39:28 -05:00
Kevin Newton b662edf0a0 [PRISM] Combine hash compilation between hashes and keywords 2024-02-13 09:37:24 -05:00
Kevin Newton c0e121420b [PRISM] Fix compilation of hash with multiple merges 2024-02-13 09:37:24 -05:00
Kevin Newton 1395838e18 [PRISM] Check full lines for invalid UTF-8 2024-02-12 14:48:09 -05:00
eileencodes a3ceb69168 [PRISM] Fix error handling in `pm_parse_prism`
Following changes made in ruby/prism#2365 this implements error handling
for when `pm_string_mapped_init` returns `false`.

Related: ruby/prism#2207
2024-02-11 09:41:20 -05:00
Kevin Newton f7467e70e1 Split line_no and node_id before new_insn_body
Before this commit, there were many places where we had to generate
dummy line nodes to hold both the line number and the node id that
would then immediately get pulled out from the created node. Now
we pass them explicitly so that we don't have to generate these
nodes.

This makes a clearer line between the parser and compiler, and also
makes it easier to generate instructions when we don't have a
specific node to tie them to. As such, it removes almost every
single place where we needed to previously generate dummy nodes.

This also makes it easier for the prism compiler, because now we
can pass in line number and node id instead of trying to generate
dummy nodes for every instruction that we compile.
2024-02-09 17:01:27 -05:00
Kevin Newton e96c838ca4 [PRISM] Fix flaky memory in scope nodes 2024-02-09 16:30:07 -05:00
Kevin Newton 5c2d96df19 [PRISM] Implement opt_case_dispatch 2024-02-09 11:26:32 -05:00
Kevin Newton a4ba62b6e5 [PRISM] Refactor case nodes for only one pass through when 2024-02-09 11:26:32 -05:00
Kevin Newton 3e03981f25 [PRISM] Compile constant paths with optimizations 2024-02-08 11:53:10 -05:00
Kevin Newton 54295ba5e1 [PRISM] Compile constant reads using opt_getconstant_path 2024-02-08 11:53:10 -05:00
Kevin Newton b2d468fced [PRISM] Refactor call opts to only check for specific ids 2024-02-08 11:53:10 -05:00
Nikita Vasilevsky c3403322df [PRISM] Use block node location when building block iseq
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-06 14:56:10 -05:00
Kevin Newton c1bc714720 [PRISM] Do not show source snippets if non-UTF-8 2024-02-06 14:31:10 -05:00
Kevin Newton ccec209b2c [PRISM] Fix fsl coming from file 2024-02-06 12:36:46 -05:00
Kevin Newton d77172b79b [PRISM] Fix deconstruct index for posts 2024-02-06 11:57:59 -05:00
Kevin Newton 26fac8f6fa [PRISM] Set correct call target flags 2024-02-06 11:21:52 -05:00
Kevin Newton c6d4071c29 [PRISM] Handle match write popped 2024-02-06 11:08:14 -05:00
Kevin Newton 1c120023f1 [PRISM] Correctly handle popped attr write 2024-02-06 10:46:27 -05:00
Kevin Newton b801a19c6a [PRISM] Handle empty interpolated statements at start of string 2024-02-06 10:13:11 -05:00
Kevin Newton d6b7eae58e [PRISM] Correct spec for defined? parentheses 2024-02-06 09:51:25 -05:00
Kevin Newton c5694c647a [PRISM] Raise ArgumentError for invalid encoding 2024-02-05 15:18:15 -05:00
Kevin Newton 10a182f597 [PRISM] Fix method return line 2024-02-05 14:42:20 -05:00
Kevin Newton 7eea066cb4 [PRISM] Fix pattern matching array with implicit rest 2024-02-05 12:54:52 -05:00
Kevin Newton ae7816bc20
[PRISM] Fix up idUMinus optimization 2024-02-05 11:57:38 -05:00
Peter Zhu 948c618bda [PRISM] Fix encoding of interpolated strings
Fixes ruby/prism#2313.
2024-02-05 11:55:44 -05:00
Jenny Shen b35cdb4758 [PRISM] Implement opt_aset_with
Part of ruby/prism#2231

Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2024-02-05 10:27:58 -05:00
Jenny Shen 8ed26a3f59 [PRISM] Refactor PM_CALL_NODE conditional
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2024-02-05 10:27:58 -05:00
Jenny Shen 8bc6fff322 [PRISM] Do not optimize safe navigation aref
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2024-02-04 11:05:02 -05:00
Jenny Shen c5d4444761 [PRISM] Do not optimize safe navigation -@/freeze
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2024-02-04 11:05:02 -05:00
Alan Wu 0854d64862 [PRISM] Selectively dup array in `foo(*splat, &block_arg)` calls
This is essentially an adaptation of aae8223c70 ("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.
2024-02-02 22:25:08 -05:00
Alan Wu 90ae8eaeca [PRISM] Fix numbered parameters stealing local names
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.
2024-02-02 18:50:41 -05:00
Peter Zhu 24cdafb2f8 [PRISM] Fix indentation of pm_scope_node_init [ci skip] 2024-02-02 14:36:08 -05:00
Alan Wu 8d33be9833
[PRISM] Respect string encoding override in array literals
Fixes `TestZlibGzipReader#test_gets2`,
`Psych_Unit_Tests#test_spec_explicit_families`, and many failures in
`test_unicode_normalize.rb`.
2024-02-01 22:11:32 +00:00
Jenny Shen 4fbdbde088 [PRISM] dedup hash string keys
Fixes ruby/prism#2321

Co-authored-by:  Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by:  Peter Zhu <peter@peterzhu.ca>
2024-02-01 15:52:33 -05:00
Kevin Newton 332d2c92d8 [PRISM] Emit parse warnings 2024-02-01 15:52:19 -05:00
Alan Wu b47d43fa9b [PRISM] Use rb_fstring() on all string literals
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.
2024-02-01 15:50:32 -05:00
Nikita Vasilevsky c7fe3ecb49 [prism] Use block opening line as `source_location` line of lambda
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
2024-02-01 15:23:39 -05:00
Alan Wu 1f226b41f0 [PRISM] Fix multiple return with splat and splat+kwsplat
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.
2024-02-01 10:33:54 -05:00
Kevin Newton a7b47f96f3 [PRISM] Add splatkw to super calls when necessary 2024-01-31 22:18:55 -05:00
Kevin Newton d96b4586e4 [PRISM] Fix up index write nodes to match 2024-01-31 22:18:55 -05:00
Kevin Newton d36c31ed9b [PRISM] Fix keywords in index write nodes 2024-01-31 22:18:55 -05:00
Kevin Newton 8acd1f708f [PRISM] Fix combination of safe navigation and ||= and &&= operators 2024-01-31 22:18:55 -05:00
Kevin Newton 4d01c59042 [PRISM] Fix combination of attribute write and safe navigation 2024-01-31 22:18:55 -05:00
Kevin Newton b5a2c60d0a [PRISM] Support SCRIPT_LINES__ 2024-01-31 15:49:32 -05:00
Peter Zhu cb98b018c0 [PRISM] Fix else with rescue
Fixes ruby/prism#2307.
2024-01-31 14:11:14 -05:00
Étienne Barrié c28ee91263 [PRISM] Fix incorrect use of VM_CALL_KW_SPLAT_MUT in zsuper with keyword splat
This copies the changes from 771a2f039b.
Fixes ruby/prism#2310.
2024-01-31 13:41:49 -05:00
Kevin Newton 610636fd6b [PRISM] Mirror iseq APIs
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.
2024-01-31 13:41:36 -05:00
Matt Valentine-House 8041b7d967 [PRISM] pm_compile_logical: Fix OrNode in IfNode predicate
Fixes: https://github.com/ruby/prism/issues/2294
2024-01-30 22:22:39 +00:00
Matt Valentine-House 1142ed2f50 [PRISM] Remove unneccessary uses of cond_seq
As this is compiled into only on the recursive call and then added, we
can just use `ret` directly
2024-01-30 22:22:39 +00:00
Aaron Patterson 8e708e4a07 Update forwarding locals for prism 2024-01-30 13:19:06 -05:00
Peter Zhu c85e28d12a [PRISM] Remove unused variable 2024-01-30 10:29:11 -05:00
Kevin Newton 83966a57fe [PRISM] Method location for calls 2024-01-29 22:22:30 -05:00
Peter Zhu bbb7ab906e [PRISM] Fix crash when multiple underscores
Fixes ruby/prism#2295.
2024-01-29 17:15:33 -05:00
Kevin Newton 3fb741069d [PRISM] Fix rescue frame label 2024-01-29 16:38:11 -05:00
Peter Zhu 8e1fe15b4a [PRISM] Implement opt_str_uminus 2024-01-29 16:34:25 -05:00
Peter Zhu 32bbf47500 [PRISM] Use opt_str_freeze instruction
Fixes ruby/prism#2290.
2024-01-29 14:53:34 -05:00
Matt Valentine-House d7501c4031 [PRISM] Fix InterpolatedStringNode
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
2024-01-29 19:13:53 +00:00
Peter Zhu 3d3d9e8397 [PRISM] Support US-ASCII symbols 2024-01-29 13:56:54 -05:00
Peter Zhu d980c89273 [PRISM] Support ASCII-8BIT symbols 2024-01-29 13:56:54 -05:00
Peter Zhu f634c7a268 [PRISM] Support UTF-8 symbols
Fixes ruby/prism#2242.
2024-01-29 13:56:54 -05:00
Peter Zhu 9a5a11f3d0 [PRISM] Use the splatkw instruction
Fixes ruby/prism#2272.
2024-01-29 11:42:40 -05:00
Matt Valentine-House c422805bbb [PRISM] Fix encoding for interpolated strings.
This wasn't taking into account strings with flags set on the containing
node that could affect the encoding. It does now
2024-01-29 10:04:16 -05:00
Kevin Newton cb9a47f2ac [PRISM] Fix branchif ADD_INSN1 2024-01-26 16:46:31 -05:00
Peter Zhu a120529020 [PRISM] Fix loop in rescue blocks
Fixes ruby/prism#2250.

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-01-26 16:07:24 -05:00
Peter Zhu 59bb78ebd0 [PRISM] Fix for s390x
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.
2024-01-26 15:41:06 -05:00
Peter Zhu 3d996e827f [PRISM] Keyword arguments incorrectly passed as mutable
Fixes ruby/prism#2279.
2024-01-26 14:58:29 -05:00
Matt Valentine-House e452caac10 [PRISM] Fix next inside rescue 2024-01-25 15:10:52 -05:00
Kevin Newton 1301422dfe [PRISM] Fix VM_CALL_ARGS_SPLAT_MUT failures 2024-01-25 11:11:50 -05:00