diff options
author | Kevin Newton <[email protected]> | 2024-07-24 10:54:32 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-07-24 12:02:33 -0400 |
commit | 1a18b03ee7b14771eae9eafa3c85a6bf5ccd9502 () | |
tree | 523edbb8855327293e019ca6d63c4e9cb8d4bc78 /prism_compile.c | |
parent | 0a9f771e19cc472651a3ab66d916bb8f65aab11a (diff) |
[PRISM] Add anon_* flags for iseqs with anonymous * and **
Notes: Merged: https://.com/ruby/ruby/pull/11236
-rw-r--r-- | prism_compile.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -8765,6 +8765,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, else { // def foo(a, (b, *c, d), e = 1, *, g, (h, *i, j), k:, l: 1, **m, &n) // ^ pm_insert_local_special(idMULT, local_index, index_lookup_table, local_table_for_iseq); } @@ -8944,6 +8945,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, } } else { pm_insert_local_special(idPow, local_index, index_lookup_table, local_table_for_iseq); } @@ -8954,30 +8956,28 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, // ^^^ case PM_FORWARDING_PARAMETER_NODE: { if (!ISEQ_BODY(iseq)->param.flags.forwardable) { body->param.rest_start = local_index; body->param.flags.has_rest = true; - - // Add the leading * pm_insert_local_special(idMULT, local_index++, index_lookup_table, local_table_for_iseq); - // Add the kwrest ** RUBY_ASSERT(!body->param.flags.has_kw); - - // There are no keywords declared (in the text of the program) - // but the forwarding node implies we support kwrest (**) body->param.flags.has_kw = false; body->param.flags.has_kwrest = true; body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1); - keyword->rest_start = local_index; - pm_insert_local_special(idPow, local_index++, index_lookup_table, local_table_for_iseq); body->param.block_start = local_index; body->param.flags.has_block = true; - pm_insert_local_special(idAnd, local_index++, index_lookup_table, local_table_for_iseq); } pm_insert_local_special(idDot3, local_index++, index_lookup_table, local_table_for_iseq); break; } |