diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-10-23 12:06:21 -0400 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-10-26 14:58:48 -0400 |
commit | 234e8fb819f0fc1d6f05a02976ae1c01e6cace2d (patch) | |
tree | 8791c06496005aa0b190445ecedd48725204416a | |
parent | 7e4ee92de225473d3ad3ac8d0a27bd02a2905738 (diff) | |
download | ruby-234e8fb819f0fc1d6f05a02976ae1c01e6cace2d.tar.gz |
[ruby/prism] Split up multi target/write targets
https://github.com/ruby/prism/commit/dda7a0da52
46 files changed, 553 insertions, 341 deletions
diff --git a/prism/config.yml b/prism/config.yml index 1d193e9ae6..84f422c725 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -1922,7 +1922,11 @@ nodes: ^^^^^^^^^^^^^^ - name: MultiTargetNode fields: - - name: targets + - name: requireds + type: node[] + - name: rest + type: node? + - name: posts type: node[] - name: lparen_loc type: location? @@ -1935,7 +1939,11 @@ nodes: ^^^^^^ - name: MultiWriteNode fields: - - name: targets + - name: requireds + type: node[] + - name: rest + type: node? + - name: posts type: node[] - name: lparen_loc type: location? diff --git a/prism/prism.c b/prism/prism.c index d8977d2dfd..6b9c20a4bd 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -3611,7 +3611,9 @@ pm_multi_target_node_create(pm_parser_t *parser) { .type = PM_MULTI_TARGET_NODE, .location = { .start = NULL, .end = NULL } }, - .targets = PM_EMPTY_NODE_LIST, + .requireds = PM_EMPTY_NODE_LIST, + .rest = NULL, + .posts = PM_EMPTY_NODE_LIST, .lparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .rparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE }; @@ -3621,8 +3623,19 @@ pm_multi_target_node_create(pm_parser_t *parser) { // Append a target to a MultiTargetNode node. static void -pm_multi_target_node_targets_append(pm_multi_target_node_t *node, pm_node_t *target) { - pm_node_list_append(&node->targets, target); +pm_multi_target_node_targets_append(pm_parser_t *parser, pm_multi_target_node_t *node, pm_node_t *target) { + if (PM_NODE_TYPE_P(target, PM_SPLAT_NODE)) { + if (node->rest == NULL) { + node->rest = target; + } else { + pm_parser_err_node(parser, target, PM_ERR_MULTI_ASSIGN_MULTI_SPLATS); + pm_node_list_append(&node->posts, target); + } + } else if (node->rest == NULL) { + pm_node_list_append(&node->requireds, target); + } else { + pm_node_list_append(&node->posts, target); + } if (node->base.location.start == NULL || (node->base.location.start > target->location.start)) { node->base.location.start = target->location.start; @@ -3646,7 +3659,9 @@ pm_multi_write_node_create(pm_parser_t *parser, pm_multi_target_node_t *target, .end = value->location.end } }, - .targets = target->targets, + .requireds = target->requireds, + .rest = target->rest, + .posts = target->posts, .lparen_loc = target->lparen_loc, .rparen_loc = target->rparen_loc, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -9492,7 +9507,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target) { } pm_multi_target_node_t *multi_target = pm_multi_target_node_create(parser); - pm_multi_target_node_targets_append(multi_target, (pm_node_t *) splat); + pm_multi_target_node_targets_append(parser, multi_target, (pm_node_t *) splat); return (pm_node_t *) multi_target; } @@ -9641,7 +9656,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod } pm_multi_target_node_t *multi_target = pm_multi_target_node_create(parser); - pm_multi_target_node_targets_append(multi_target, (pm_node_t *) splat); + pm_multi_target_node_targets_append(parser, multi_target, (pm_node_t *) splat); return (pm_node_t *) pm_multi_write_node_create(parser, multi_target, operator, value); } @@ -9757,7 +9772,7 @@ parse_targets(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t b bool has_splat = PM_NODE_TYPE_P(first_target, PM_SPLAT_NODE); pm_multi_target_node_t *result = pm_multi_target_node_create(parser); - pm_multi_target_node_targets_append(result, parse_target(parser, first_target)); + pm_multi_target_node_targets_append(parser, result, parse_target(parser, first_target)); while (accept1(parser, PM_TOKEN_COMMA)) { if (accept1(parser, PM_TOKEN_USTAR)) { @@ -9777,19 +9792,19 @@ parse_targets(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t b } pm_node_t *splat = (pm_node_t *) pm_splat_node_create(parser, &star_operator, name); - pm_multi_target_node_targets_append(result, splat); + pm_multi_target_node_targets_append(parser, result, splat); has_splat = true; } else if (token_begins_expression_p(parser->current.type)) { pm_node_t *target = parse_expression(parser, binding_power, PM_ERR_EXPECT_EXPRESSION_AFTER_COMMA); target = parse_target(parser, target); - pm_multi_target_node_targets_append(result, target); + pm_multi_target_node_targets_append(parser, result, target); } else { // If we get here, then we have a trailing , in a multi target node. // We need to indicate this somehow in the tree, so we'll add an // anonymous splat. pm_node_t *splat = (pm_node_t *) pm_splat_node_create(parser, &parser->previous, NULL); - pm_multi_target_node_targets_append(result, splat); + pm_multi_target_node_targets_append(parser, result, splat); break; } } @@ -12517,7 +12532,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) { multi_target = (pm_multi_target_node_t *) statement; } else { multi_target = pm_multi_target_node_create(parser); - pm_multi_target_node_targets_append(multi_target, statement); + pm_multi_target_node_targets_append(parser, multi_target, statement); } pm_location_t lparen_loc = PM_LOCATION_TOKEN_VALUE(&opening); diff --git a/test/prism/constant_path_node_test.rb b/test/prism/constant_path_node_test.rb index 1a44fbaba5..4d202b8bdc 100644 --- a/test/prism/constant_path_node_test.rb +++ b/test/prism/constant_path_node_test.rb @@ -23,8 +23,7 @@ module Prism RUBY node = Prism.parse(source).value.statements.body.first - target = node.targets.first - assert_equal("Foo::Bar::Baz::Qux", target.full_name) + assert_equal("Foo::Bar::Baz::Qux", node.requireds.first.full_name) end end end diff --git a/test/prism/location_test.rb b/test/prism/location_test.rb index 25af1f7618..3ca0ad6cfd 100644 --- a/test/prism/location_test.rb +++ b/test/prism/location_test.rb @@ -224,7 +224,7 @@ module Prism def test_ClassVariableTargetNode assert_location(ClassVariableTargetNode, "@@foo, @@bar = baz", 0...5) do |node| - node.targets.first + node.requireds.first end end @@ -252,7 +252,7 @@ module Prism def test_ConstantPathTargetNode assert_location(ConstantPathTargetNode, "::Foo, ::Bar = baz", 0...5) do |node| - node.targets.first + node.requireds.first end end @@ -281,7 +281,7 @@ module Prism def test_ConstantTargetNode assert_location(ConstantTargetNode, "Foo, Bar = baz", 0...3) do |node| - node.targets.first + node.requireds.first end end @@ -379,7 +379,7 @@ module Prism def test_GlobalVariableTargetNode assert_location(GlobalVariableTargetNode, "$foo, $bar = baz", 0...4) do |node| - node.targets.first + node.requireds.first end end @@ -457,7 +457,7 @@ module Prism def test_InstanceVariableTargetNode assert_location(InstanceVariableTargetNode, "@foo, @bar = baz", 0...4) do |node| - node.targets.first + node.requireds.first end end @@ -548,7 +548,7 @@ module Prism def test_LocalVariableTargetNode assert_location(LocalVariableTargetNode, "foo, bar = baz", 0...3) do |node| - node.targets.first + node.requireds.first end end @@ -578,7 +578,7 @@ module Prism def test_MultiTargetNode assert_location(MultiTargetNode, "for foo, bar in baz do end", 4...12, &:index) - assert_location(MultiTargetNode, "foo, (bar, baz) = qux", 5...15) { |node| node.targets.last } + assert_location(MultiTargetNode, "foo, (bar, baz) = qux", 5...15) { |node| node.requireds.last } end def test_MultiWriteNode @@ -736,7 +736,7 @@ module Prism end def test_SplatNode - assert_location(SplatNode, "*foo = bar", 0...4) { |node| node.targets.first } + assert_location(SplatNode, "*foo = bar", 0...4, &:rest) end def test_StatementsNode diff --git a/test/prism/snapshots/arrays.txt b/test/prism/snapshots/arrays.txt index 2440f512fd..0b1426cc96 100644 --- a/test/prism/snapshots/arrays.txt +++ b/test/prism/snapshots/arrays.txt @@ -407,7 +407,7 @@ │ ├── flags: ∅ │ └── name: :[]= ├── @ MultiWriteNode (location: (41,0)-(41,21)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (41,0)-(41,6)) │ │ │ ├── receiver: │ │ │ │ @ CallNode (location: (41,0)-(41,3)) @@ -458,6 +458,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (41,15)-(41,16) = "=" diff --git a/test/prism/snapshots/for.txt b/test/prism/snapshots/for.txt index edad357379..5b1b2a8a55 100644 --- a/test/prism/snapshots/for.txt +++ b/test/prism/snapshots/for.txt @@ -56,13 +56,15 @@ ├── @ ForNode (location: (7,0)-(9,3)) │ ├── index: │ │ @ MultiTargetNode (location: (7,4)-(7,7)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (7,4)-(7,5)) │ │ │ │ ├── name: :i │ │ │ │ └── depth: 1 │ │ │ └── @ LocalVariableTargetNode (location: (7,6)-(7,7)) │ │ │ ├── name: :j │ │ │ └── depth: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── collection: @@ -88,7 +90,7 @@ ├── @ ForNode (location: (11,0)-(13,3)) │ ├── index: │ │ @ MultiTargetNode (location: (11,4)-(11,9)) - │ │ ├── targets: (length: 3) + │ │ ├── requireds: (length: 3) │ │ │ ├── @ LocalVariableTargetNode (location: (11,4)-(11,5)) │ │ │ │ ├── name: :i │ │ │ │ └── depth: 1 @@ -98,6 +100,8 @@ │ │ │ └── @ LocalVariableTargetNode (location: (11,8)-(11,9)) │ │ │ ├── name: :k │ │ │ └── depth: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── collection: diff --git a/test/prism/snapshots/method_calls.txt b/test/prism/snapshots/method_calls.txt index 8704f58f0f..a5bc0a1394 100644 --- a/test/prism/snapshots/method_calls.txt +++ b/test/prism/snapshots/method_calls.txt @@ -499,7 +499,7 @@ │ ├── flags: ∅ │ └── name: :b ├── @ MultiWriteNode (location: (41,0)-(41,23)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (41,0)-(41,7)) │ │ │ ├── receiver: │ │ │ │ @ CallNode (location: (41,0)-(41,3)) @@ -540,6 +540,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :bar= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (41,17)-(41,18) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt index 5ccc262305..bac1576259 100644 --- a/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt @@ -4,17 +4,21 @@ @ StatementsNode (location: (1,0)-(1,8)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,8)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,0)-(1,1)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ ├── name: :a │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,5)-(1,6) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt index 87b7f012d8..892c1e7597 100644 --- a/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(1,11)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,11)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 @@ -28,6 +28,8 @@ │ ├── block: ∅ │ ├── flags: ∅ │ └── name: :c= + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,8)-(1,9) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_ident.txt b/test/prism/snapshots/seattlerb/masgn_arg_ident.txt index 11819f9ac1..2df83ce440 100644 --- a/test/prism/snapshots/seattlerb/masgn_arg_ident.txt +++ b/test/prism/snapshots/seattlerb/masgn_arg_ident.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(1,10)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,10)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 @@ -28,6 +28,8 @@ │ ├── block: ∅ │ ├── flags: ∅ │ └── name: :C= + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt index a350febe3c..092e75ecf9 100644 --- a/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt @@ -4,16 +4,18 @@ @ StatementsNode (location: (1,0)-(1,12)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,12)) - ├── targets: (length: 3) - │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) - │ │ ├── name: :a - │ │ └── depth: 0 - │ ├── @ SplatNode (location: (1,3)-(1,5)) - │ │ ├── operator_loc: (1,3)-(1,4) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) - │ │ ├── name: :b - │ │ └── depth: 0 + ├── requireds: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,3)-(1,5)) + │ ├── operator_loc: (1,3)-(1,4) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ ├── name: :b + │ └── depth: 0 + ├── posts: (length: 1) │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ ├── name: :c │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/masgn_colon2.txt b/test/prism/snapshots/seattlerb/masgn_colon2.txt index 2c9ecd75bb..45f95483c6 100644 --- a/test/prism/snapshots/seattlerb/masgn_colon2.txt +++ b/test/prism/snapshots/seattlerb/masgn_colon2.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(1,14)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,14)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 @@ -24,6 +24,8 @@ │ │ @ ConstantReadNode (location: (1,6)-(1,7)) │ │ └── name: :C │ └── delimiter_loc: (1,4)-(1,6) = "::" + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,8)-(1,9) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_colon3.txt b/test/prism/snapshots/seattlerb/masgn_colon3.txt index 1c97b15d23..5f5c175d32 100644 --- a/test/prism/snapshots/seattlerb/masgn_colon3.txt +++ b/test/prism/snapshots/seattlerb/masgn_colon3.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(1,15)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,15)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ ConstantPathTargetNode (location: (1,0)-(1,3)) │ │ ├── parent: ∅ │ │ ├── child: @@ -17,6 +17,8 @@ │ │ @ ConstantReadNode (location: (1,7)-(1,8)) │ │ └── name: :B │ └── delimiter_loc: (1,5)-(1,7) = "::" + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,9)-(1,10) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_command_call.txt b/test/prism/snapshots/seattlerb/masgn_command_call.txt index 5f20de9ec1..4b108678ed 100644 --- a/test/prism/snapshots/seattlerb/masgn_command_call.txt +++ b/test/prism/snapshots/seattlerb/masgn_command_call.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,10)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,10)) - ├── targets: (length: 2) - │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) - │ │ ├── name: :a - │ │ └── depth: 0 - │ └── @ SplatNode (location: (1,1)-(1,2)) - │ ├── operator_loc: (1,1)-(1,2) = "," - │ └── expression: ∅ + ├── requireds: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,1)-(1,2)) + │ ├── operator_loc: (1,1)-(1,2) = "," + │ └── expression: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,3)-(1,4) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_double_paren.txt b/test/prism/snapshots/seattlerb/masgn_double_paren.txt index d9bc98dbe8..aa312f1b06 100644 --- a/test/prism/snapshots/seattlerb/masgn_double_paren.txt +++ b/test/prism/snapshots/seattlerb/masgn_double_paren.txt @@ -4,17 +4,21 @@ @ StatementsNode (location: (1,0)-(1,9)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,9)) - ├── targets: (length: 1) + ├── requireds: (length: 1) │ └── @ MultiTargetNode (location: (1,1)-(1,6)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (1,1)-(1,2) = "(" │ └── rparen_loc: (1,5)-(1,6) = ")" + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: (1,0)-(1,1) = "(" ├── rparen_loc: (1,6)-(1,7) = ")" ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt b/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt index 49b717143b..691bca7bcf 100644 --- a/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt +++ b/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,12)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,12)) - ├── targets: (length: 1) - │ └── @ SplatNode (location: (1,0)-(1,2)) - │ ├── operator_loc: (1,0)-(1,1) = "*" - │ └── expression: - │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) - │ ├── name: :a - │ └── depth: 0 + ├── requireds: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :a + │ └── depth: 0 + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,3)-(1,4) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_paren.txt b/test/prism/snapshots/seattlerb/masgn_paren.txt index 9e8ce7a49d..7fd51b652a 100644 --- a/test/prism/snapshots/seattlerb/masgn_paren.txt +++ b/test/prism/snapshots/seattlerb/masgn_paren.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,12)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,12)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,2)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: (1,0)-(1,1) = "(" ├── rparen_loc: (1,5)-(1,6) = ")" ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt index 49a30e983a..30f451fcb6 100644 --- a/test/prism/snapshots/seattlerb/masgn_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt @@ -4,20 +4,24 @@ @ StatementsNode (location: (1,0)-(1,9)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,9)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: - │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,6)-(1,7) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt index c22d376e06..386ad7b563 100644 --- a/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt @@ -4,15 +4,17 @@ @ StatementsNode (location: (1,0)-(1,12)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,12)) - ├── targets: (length: 3) + ├── requireds: (length: 3) │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: - │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) @@ -21,6 +23,8 @@ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ ├── name: :c │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,9)-(1,10) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_star.txt b/test/prism/snapshots/seattlerb/masgn_star.txt index f86b63fbd0..3bb9d34d0d 100644 --- a/test/prism/snapshots/seattlerb/masgn_star.txt +++ b/test/prism/snapshots/seattlerb/masgn_star.txt @@ -4,10 +4,12 @@ @ StatementsNode (location: (1,0)-(1,5)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,5)) - ├── targets: (length: 1) - │ └── @ SplatNode (location: (1,0)-(1,1)) - │ ├── operator_loc: (1,0)-(1,1) = "*" - │ └── expression: ∅ + ├── requireds: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/masgn_var_star_var.txt b/test/prism/snapshots/seattlerb/masgn_var_star_var.txt index 7b9e935454..c78ba14ade 100644 --- a/test/prism/snapshots/seattlerb/masgn_var_star_var.txt +++ b/test/prism/snapshots/seattlerb/masgn_var_star_var.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,11)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,11)) - ├── targets: (length: 3) - │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) - │ │ ├── name: :a - │ │ └── depth: 0 - │ ├── @ SplatNode (location: (1,3)-(1,4)) - │ │ ├── operator_loc: (1,3)-(1,4) = "*" - │ │ └── expression: ∅ + ├── requireds: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,3)-(1,4)) + │ ├── operator_loc: (1,3)-(1,4) = "*" + │ └── expression: ∅ + ├── posts: (length: 1) │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) │ ├── name: :b │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt index e1c1b23e9f..6558a5c7b2 100644 --- a/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt @@ -4,19 +4,21 @@ @ StatementsNode (location: (1,0)-(1,14)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,14)) - ├── targets: (length: 4) + ├── requireds: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ │ ├── name: :b │ │ └── depth: 0 - │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) - │ │ ├── name: :c - │ │ └── depth: 0 - │ └── @ SplatNode (location: (1,9)-(1,10)) - │ ├── operator_loc: (1,9)-(1,10) = "*" - │ └── expression: ∅ + │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :c + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,10)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,11)-(1,12) = "=" diff --git a/test/prism/snapshots/seattlerb/mlhs_back_splat.txt b/test/prism/snapshots/seattlerb/mlhs_back_splat.txt index 0f1d46ae80..df560b2c35 100644 --- a/test/prism/snapshots/seattlerb/mlhs_back_splat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_back_splat.txt @@ -4,22 +4,24 @@ @ StatementsNode (location: (1,0)-(1,15)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,15)) - ├── targets: (length: 4) + ├── requireds: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ │ ├── name: :b │ │ └── depth: 0 - │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) - │ │ ├── name: :c - │ │ └── depth: 0 - │ └── @ SplatNode (location: (1,9)-(1,11)) - │ ├── operator_loc: (1,9)-(1,10) = "*" - │ └── expression: - │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) - │ ├── name: :s - │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :c + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,11)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :s + │ └── depth: 0 + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,12)-(1,13) = "=" diff --git a/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt index af2c8c9c85..04df31deaa 100644 --- a/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt @@ -4,12 +4,14 @@ @ StatementsNode (location: (1,0)-(1,14)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,14)) - ├── targets: (length: 4) + ├── requireds: (length: 4) │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,0)-(1,1)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) @@ -21,6 +23,8 @@ │ └── @ LocalVariableTargetNode (location: (1,9)-(1,10)) │ ├── name: :z │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,11)-(1,12) = "=" diff --git a/test/prism/snapshots/seattlerb/mlhs_front_splat.txt b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt index 08996bba60..51cd7fbfca 100644 --- a/test/prism/snapshots/seattlerb/mlhs_front_splat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt @@ -4,15 +4,17 @@ @ StatementsNode (location: (1,0)-(1,15)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,15)) - ├── targets: (length: 4) + ├── requireds: (length: 4) │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: - │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) - │ │ │ ├── name: :s - │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :s + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) @@ -24,6 +26,8 @@ │ └── @ LocalVariableTargetNode (location: (1,10)-(1,11)) │ ├── name: :z │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,12)-(1,13) = "=" diff --git a/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt index 6f98c0efeb..3798c89220 100644 --- a/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt @@ -4,19 +4,21 @@ @ StatementsNode (location: (1,0)-(1,23)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,23)) - ├── targets: (length: 7) + ├── requireds: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ │ ├── name: :b │ │ └── depth: 0 - │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) - │ │ ├── name: :c - │ │ └── depth: 0 - │ ├── @ SplatNode (location: (1,9)-(1,10)) - │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ └── expression: ∅ + │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :c + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,10)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: ∅ + ├── posts: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,12)-(1,13)) │ │ ├── name: :x │ │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt b/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt index 01e181f347..26bfddeae8 100644 --- a/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt @@ -4,22 +4,24 @@ @ StatementsNode (location: (1,0)-(1,24)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,24)) - ├── targets: (length: 7) + ├── requireds: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ │ ├── name: :b │ │ └── depth: 0 - │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) - │ │ ├── name: :c - │ │ └── depth: 0 - │ ├── @ SplatNode (location: (1,9)-(1,11)) - │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) - │ │ ├── name: :s - │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :c + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,11)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :s + │ └── depth: 0 + ├── posts: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,13)-(1,14)) │ │ ├── name: :x │ │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/mlhs_rescue.txt b/test/prism/snapshots/seattlerb/mlhs_rescue.txt index 9f833537ab..a9a619cf56 100644 --- a/test/prism/snapshots/seattlerb/mlhs_rescue.txt +++ b/test/prism/snapshots/seattlerb/mlhs_rescue.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,18)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,18)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,5)-(1,6) = "=" diff --git a/test/prism/snapshots/seattlerb/parse_line_to_ary.txt b/test/prism/snapshots/seattlerb/parse_line_to_ary.txt index 7aa6dcd035..8f7ff1b75c 100644 --- a/test/prism/snapshots/seattlerb/parse_line_to_ary.txt +++ b/test/prism/snapshots/seattlerb/parse_line_to_ary.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(3,1)) └── body: (length: 2) ├── @ MultiWriteNode (location: (1,0)-(2,5)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (2,0)-(2,1)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (2,2)-(2,3) = "=" diff --git a/test/prism/snapshots/unparser/corpus/literal/assignment.txt b/test/prism/snapshots/unparser/corpus/literal/assignment.txt index fd22b8a60f..f7d66f4c9e 100644 --- a/test/prism/snapshots/unparser/corpus/literal/assignment.txt +++ b/test/prism/snapshots/unparser/corpus/literal/assignment.txt @@ -11,11 +11,13 @@ │ │ └── flags: decimal │ └── operator_loc: (1,3)-(1,4) = "=" ├── @ MultiWriteNode (location: (2,0)-(2,17)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ GlobalVariableTargetNode (location: (2,1)-(2,3)) │ │ │ └── name: :$a │ │ └── @ GlobalVariableTargetNode (location: (2,5)-(2,7)) │ │ └── name: :$b + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (2,0)-(2,1) = "(" │ ├── rparen_loc: (2,7)-(2,8) = ")" │ ├── operator_loc: (2,9)-(2,10) = "=" @@ -29,20 +31,24 @@ │ ├── opening_loc: (2,11)-(2,12) = "[" │ └── closing_loc: (2,16)-(2,17) = "]" ├── @ MultiWriteNode (location: (3,0)-(3,13)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ MultiTargetNode (location: (3,1)-(3,5)) - │ │ │ ├── targets: (length: 2) - │ │ │ │ ├── @ LocalVariableTargetNode (location: (3,2)-(3,3)) - │ │ │ │ │ ├── name: :a - │ │ │ │ │ └── depth: 0 - │ │ │ │ └── @ SplatNode (location: (3,3)-(3,4)) - │ │ │ │ ├── operator_loc: (3,3)-(3,4) = "," - │ │ │ │ └── expression: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (3,2)-(3,3)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (3,3)-(3,4)) + │ │ │ │ ├── operator_loc: (3,3)-(3,4) = "," + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (length: 0) │ │ │ ├── lparen_loc: (3,1)-(3,2) = "(" │ │ │ └── rparen_loc: (3,4)-(3,5) = ")" │ │ └── @ LocalVariableTargetNode (location: (3,7)-(3,8)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (3,0)-(3,1) = "(" │ ├── rparen_loc: (3,8)-(3,9) = ")" │ ├── operator_loc: (3,10)-(3,11) = "=" @@ -50,13 +56,15 @@ │ @ IntegerNode (location: (3,12)-(3,13)) │ └── flags: decimal ├── @ MultiWriteNode (location: (4,0)-(4,9)) - │ ├── targets: (length: 1) - │ │ └── @ SplatNode (location: (4,1)-(4,3)) - │ │ ├── operator_loc: (4,1)-(4,2) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (4,2)-(4,3)) - │ │ ├── name: :a - │ │ └── depth: 0 + │ ├── requireds: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (4,1)-(4,3)) + │ │ ├── operator_loc: (4,1)-(4,2) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (4,2)-(4,3)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: (4,0)-(4,1) = "(" │ ├── rparen_loc: (4,3)-(4,4) = ")" │ ├── operator_loc: (4,5)-(4,6) = "=" @@ -66,13 +74,15 @@ │ ├── opening_loc: (4,7)-(4,8) = "[" │ └── closing_loc: (4,8)-(4,9) = "]" ├── @ MultiWriteNode (location: (5,0)-(5,15)) - │ ├── targets: (length: 1) - │ │ └── @ SplatNode (location: (5,1)-(5,5)) - │ │ ├── operator_loc: (5,1)-(5,2) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (5,2)-(5,5)) - │ │ ├── name: :foo - │ │ └── depth: 0 + │ ├── requireds: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (5,1)-(5,5)) + │ │ ├── operator_loc: (5,1)-(5,2) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (5,2)-(5,5)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: (5,0)-(5,1) = "(" │ ├── rparen_loc: (5,5)-(5,6) = ")" │ ├── operator_loc: (5,7)-(5,8) = "=" @@ -86,11 +96,13 @@ │ ├── opening_loc: (5,9)-(5,10) = "[" │ └── closing_loc: (5,14)-(5,15) = "]" ├── @ MultiWriteNode (location: (6,0)-(6,19)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ ClassVariableTargetNode (location: (6,1)-(6,4)) │ │ │ └── name: :@@a │ │ └── @ ClassVariableTargetNode (location: (6,6)-(6,9)) │ │ └── name: :@@b + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (6,0)-(6,1) = "(" │ ├── rparen_loc: (6,9)-(6,10) = ")" │ ├── operator_loc: (6,11)-(6,12) = "=" @@ -104,11 +116,13 @@ │ ├── opening_loc: (6,13)-(6,14) = "[" │ └── closing_loc: (6,18)-(6,19) = "]" ├── @ MultiWriteNode (location: (7,0)-(7,17)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (7,1)-(7,3)) │ │ │ └── name: :@a │ │ └── @ InstanceVariableTargetNode (location: (7,5)-(7,7)) │ │ └── name: :@b + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (7,0)-(7,1) = "(" │ ├── rparen_loc: (7,7)-(7,8) = ")" │ ├── operator_loc: (7,9)-(7,10) = "=" @@ -122,20 +136,24 @@ │ ├── opening_loc: (7,11)-(7,12) = "[" │ └── closing_loc: (7,16)-(7,17) = "]" ├── @ MultiWriteNode (location: (8,0)-(8,25)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (8,1)-(8,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ MultiTargetNode (location: (8,4)-(8,10)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (8,5)-(8,6)) │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (8,8)-(8,9)) │ │ │ ├── name: :c │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: (8,4)-(8,5) = "(" │ │ └── rparen_loc: (8,9)-(8,10) = ")" + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (8,0)-(8,1) = "(" │ ├── rparen_loc: (8,10)-(8,11) = ")" │ ├── operator_loc: (8,12)-(8,13) = "=" @@ -155,13 +173,15 @@ │ ├── opening_loc: (8,14)-(8,15) = "[" │ └── closing_loc: (8,24)-(8,25) = "]" ├── @ MultiWriteNode (location: (9,0)-(9,15)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (9,1)-(9,2)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (9,4)-(9,5)) - │ │ ├── operator_loc: (9,4)-(9,5) = "*" - │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (9,1)-(9,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (9,4)-(9,5)) + │ │ ├── operator_loc: (9,4)-(9,5) = "*" + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (9,0)-(9,1) = "(" │ ├── rparen_loc: (9,5)-(9,6) = ")" │ ├── operator_loc: (9,7)-(9,8) = "=" @@ -175,16 +195,18 @@ │ ├── opening_loc: (9,9)-(9,10) = "[" │ └── closing_loc: (9,14)-(9,15) = "]" ├── @ MultiWriteNode (location: (10,0)-(10,18)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (10,1)-(10,2)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (10,4)-(10,8)) - │ │ ├── operator_loc: (10,4)-(10,5) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (10,5)-(10,8)) - │ │ ├── name: :foo - │ │ └── depth: 0 + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (10,1)-(10,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (10,4)-(10,8)) + │ │ ├── operator_loc: (10,4)-(10,5) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (10,5)-(10,8)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: (10,0)-(10,1) = "(" │ ├── rparen_loc: (10,8)-(10,9) = ")" │ ├── operator_loc: (10,10)-(10,11) = "=" @@ -198,13 +220,15 @@ │ ├── opening_loc: (10,12)-(10,13) = "[" │ └── closing_loc: (10,17)-(10,18) = "]" ├── @ MultiWriteNode (location: (11,0)-(11,15)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (11,1)-(11,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (11,4)-(11,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (11,0)-(11,1) = "(" │ ├── rparen_loc: (11,5)-(11,6) = ")" │ ├── operator_loc: (11,7)-(11,8) = "=" @@ -218,13 +242,15 @@ │ ├── opening_loc: (11,9)-(11,10) = "[" │ └── closing_loc: (11,14)-(11,15) = "]" ├── @ MultiWriteNode (location: (12,0)-(12,12)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (12,1)-(12,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (12,4)-(12,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (12,0)-(12,1) = "(" │ ├── rparen_loc: (12,5)-(12,6) = ")" │ ├── operator_loc: (12,7)-(12,8) = "=" @@ -233,13 +259,15 @@ │ ├── name: :foo │ └── depth: 0 ├── @ MultiWriteNode (location: (13,0)-(13,10)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (13,1)-(13,2)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (13,2)-(13,3)) - │ │ ├── operator_loc: (13,2)-(13,3) = "," - │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (13,1)-(13,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (13,2)-(13,3)) + │ │ ├── operator_loc: (13,2)-(13,3) = "," + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (13,0)-(13,1) = "(" │ ├── rparen_loc: (13,3)-(13,4) = ")" │ ├── operator_loc: (13,5)-(13,6) = "=" @@ -248,7 +276,7 @@ │ ├── name: :foo │ └── depth: 0 ├── @ MultiWriteNode (location: (14,0)-(14,23)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (14,1)-(14,6)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (14,1)-(14,2)) @@ -275,6 +303,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :bar= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (14,0)-(14,1) = "(" │ ├── rparen_loc: (14,13)-(14,14) = ")" │ ├── operator_loc: (14,15)-(14,16) = "=" @@ -288,7 +318,7 @@ │ ├── opening_loc: (14,17)-(14,18) = "[" │ └── closing_loc: (14,22)-(14,23) = "]" ├── @ MultiWriteNode (location: (15,0)-(15,24)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (15,1)-(15,8)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (15,1)-(15,2)) @@ -329,6 +359,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (15,0)-(15,1) = "(" │ ├── rparen_loc: (15,14)-(15,15) = ")" │ ├── operator_loc: (15,16)-(15,17) = "=" @@ -342,7 +374,7 @@ │ ├── opening_loc: (15,18)-(15,19) = "[" │ └── closing_loc: (15,23)-(15,24) = "]" ├── @ MultiWriteNode (location: (16,0)-(16,21)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (16,1)-(16,5)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (16,1)-(16,2)) @@ -379,6 +411,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (16,0)-(16,1) = "(" │ ├── rparen_loc: (16,11)-(16,12) = ")" │ ├── operator_loc: (16,13)-(16,14) = "=" @@ -392,23 +426,25 @@ │ ├── opening_loc: (16,15)-(16,16) = "[" │ └── closing_loc: (16,20)-(16,21) = "]" ├── @ MultiWriteNode (location: (17,0)-(17,12)) - │ ├── targets: (length: 1) - │ │ └── @ SplatNode (location: (17,1)-(17,7)) - │ │ ├── operator_loc: (17,1)-(17,2) = "*" - │ │ └── expression: - │ │ @ CallNode (location: (17,2)-(17,7)) - │ │ ├── receiver: - │ │ │ @ LocalVariableReadNode (location: (17,2)-(17,3)) - │ │ │ ├── name: :c - │ │ │ └── depth: 0 - │ │ ├── call_operator_loc: (17,3)-(17,4) = "." - │ │ ├── message_loc: (17,4)-(17,7) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ ├── block: ∅ - │ │ ├── flags: ∅ - │ │ └── name: :foo= + │ ├── requireds: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (17,1)-(17,7)) + │ │ ├── operator_loc: (17,1)-(17,2) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (17,2)-(17,7)) + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (17,2)-(17,3)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: (17,3)-(17,4) = "." + │ │ ├── message_loc: (17,4)-(17,7) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: :foo= + │ ├── posts: (length: 0) │ ├── lparen_loc: (17,0)-(17,1) = "(" │ ├── rparen_loc: (17,7)-(17,8) = ")" │ ├── operator_loc: (17,9)-(17,10) = "=" @@ -482,13 +518,15 @@ │ │ │ @ StatementsNode (location: (23,5)-(23,15)) │ │ │ └── body: (length: 1) │ │ │ └── @ MultiWriteNode (location: (23,5)-(23,15)) - │ │ │ ├── targets: (length: 2) + │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ LocalVariableTargetNode (location: (23,6)-(23,7)) │ │ │ │ │ ├── name: :b │ │ │ │ │ └── depth: 0 │ │ │ │ └── @ LocalVariableTargetNode (location: (23,9)-(23,10)) │ │ │ │ ├── name: :c │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) │ │ │ ├── lparen_loc: (23,5)-(23,6) = "(" │ │ │ ├── rparen_loc: (23,10)-(23,11) = ")" │ │ │ ├── operator_loc: (23,12)-(23,13) = "=" diff --git a/test/prism/snapshots/unparser/corpus/literal/defined.txt b/test/prism/snapshots/unparser/corpus/literal/defined.txt index ffa9bfbba8..304460b0b9 100644 --- a/test/prism/snapshots/unparser/corpus/literal/defined.txt +++ b/test/prism/snapshots/unparser/corpus/literal/defined.txt @@ -25,13 +25,15 @@ │ │ @ StatementsNode (location: (3,10)-(3,25)) │ │ └── body: (length: 1) │ │ └── @ MultiWriteNode (location: (3,10)-(3,25)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (3,11)-(3,12)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (3,14)-(3,15)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: (3,10)-(3,11) = "(" │ │ ├── rparen_loc: (3,15)-(3,16) = ")" │ │ ├── operator_loc: (3,17)-(3,18) = "=" diff --git a/test/prism/snapshots/unparser/corpus/literal/for.txt b/test/prism/snapshots/unparser/corpus/literal/for.txt index dac6b67e3c..0f430d2829 100644 --- a/test/prism/snapshots/unparser/corpus/literal/for.txt +++ b/test/prism/snapshots/unparser/corpus/literal/for.txt @@ -85,16 +85,18 @@ ├── @ ForNode (location: (7,0)-(9,3)) │ ├── index: │ │ @ MultiTargetNode (location: (7,4)-(7,11)) - │ │ ├── targets: (length: 2) - │ │ │ ├── @ LocalVariableTargetNode (location: (7,5)-(7,6)) - │ │ │ │ ├── name: :a - │ │ │ │ └── depth: 1 - │ │ │ └── @ SplatNode (location: (7,8)-(7,10)) - │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" - │ │ │ └── expression: - │ │ │ @ LocalVariableTargetNode (location: (7,9)-(7,10)) - │ │ │ ├── name: :b - │ │ │ └── depth: 1 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (7,5)-(7,6)) + │ │ │ ├── name: :a + │ │ │ └── depth: 1 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (7,8)-(7,10)) + │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (7,9)-(7,10)) + │ │ │ ├── name: :b + │ │ │ └── depth: 1 + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: (7,4)-(7,5) = "(" │ │ └── rparen_loc: (7,10)-(7,11) = ")" │ ├── collection: @@ -128,13 +130,15 @@ └── @ ForNode (location: (10,0)-(12,3)) ├── index: │ @ MultiTargetNode (location: (10,4)-(10,10)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (10,5)-(10,6)) │ │ │ ├── name: :a │ │ │ └── depth: 1 │ │ └── @ LocalVariableTargetNode (location: (10,8)-(10,9)) │ │ ├── name: :b │ │ └── depth: 1 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (10,4)-(10,5) = "(" │ └── rparen_loc: (10,9)-(10,10) = ")" ├── collection: diff --git a/test/prism/snapshots/unparser/corpus/literal/send.txt b/test/prism/snapshots/unparser/corpus/literal/send.txt index be363a4cf7..63127b8601 100644 --- a/test/prism/snapshots/unparser/corpus/literal/send.txt +++ b/test/prism/snapshots/unparser/corpus/literal/send.txt @@ -21,13 +21,15 @@ │ │ │ │ @ StatementsNode (location: (2,11)-(2,21)) │ │ │ │ └── body: (length: 1) │ │ │ │ └── @ MultiWriteNode (location: (2,11)-(2,21)) - │ │ │ │ ├── targets: (length: 2) + │ │ │ │ ├── requireds: (length: 2) │ │ │ │ │ ├── @ LocalVariableTargetNode (location: (2,12)-(2,13)) │ │ │ │ │ │ ├── name: :a │ │ │ │ │ │ └── depth: 0 │ │ │ │ │ └── @ LocalVariableTargetNode (location: (2,15)-(2,16)) │ │ │ │ │ ├── name: :_ │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) │ │ │ │ ├── lparen_loc: (2,11)-(2,12) = "(" │ │ │ │ ├── rparen_loc: (2,16)-(2,17) = ")" │ │ │ │ ├── operator_loc: (2,18)-(2,19) = "=" diff --git a/test/prism/snapshots/variables.txt b/test/prism/snapshots/variables.txt index 8a0942b778..f0293522be 100644 --- a/test/prism/snapshots/variables.txt +++ b/test/prism/snapshots/variables.txt @@ -13,11 +13,13 @@ │ │ └── flags: decimal │ └── operator_loc: (3,6)-(3,7) = "=" ├── @ MultiWriteNode (location: (5,0)-(5,16)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ ClassVariableTargetNode (location: (5,0)-(5,5)) │ │ │ └── name: :@@foo │ │ └── @ ClassVariableTargetNode (location: (5,7)-(5,12)) │ │ └── name: :@@bar + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (5,13)-(5,14) = "=" @@ -74,11 +76,13 @@ │ │ └── flags: decimal │ └── operator_loc: (19,4)-(19,5) = "=" ├── @ MultiWriteNode (location: (21,0)-(21,14)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ GlobalVariableTargetNode (location: (21,0)-(21,4)) │ │ │ └── name: :$foo │ │ └── @ GlobalVariableTargetNode (location: (21,6)-(21,10)) │ │ └── name: :$bar + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (21,11)-(21,12) = "=" @@ -99,11 +103,13 @@ │ │ └── closing_loc: ∅ │ └── operator_loc: (23,5)-(23,6) = "=" ├── @ MultiWriteNode (location: (25,0)-(25,14)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (25,0)-(25,4)) │ │ │ └── name: :@foo │ │ └── @ InstanceVariableTargetNode (location: (25,6)-(25,10)) │ │ └── name: :@bar + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (25,11)-(25,12) = "=" @@ -160,13 +166,15 @@ │ │ └── closing_loc: ∅ │ └── operator_loc: (31,4)-(31,5) = "=" ├── @ MultiWriteNode (location: (33,0)-(33,13)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (33,0)-(33,3)) - │ │ │ ├── name: :foo - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (33,5)-(33,6)) - │ │ ├── operator_loc: (33,5)-(33,6) = "*" - │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (33,0)-(33,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (33,5)-(33,6)) + │ │ ├── operator_loc: (33,5)-(33,6) = "*" + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (33,7)-(33,8) = "=" @@ -180,13 +188,15 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ ├── @ MultiWriteNode (location: (35,0)-(35,11)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (35,0)-(35,3)) - │ │ │ ├── name: :foo - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (35,3)-(35,4)) - │ │ ├── operator_loc: (35,3)-(35,4) = "," - │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (35,0)-(35,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (35,3)-(35,4)) + │ │ ├── operator_loc: (35,3)-(35,4) = "," + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (35,5)-(35,6) = "=" @@ -200,16 +210,18 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ ├── @ MultiWriteNode (location: (37,0)-(37,16)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (37,0)-(37,3)) - │ │ │ ├── name: :foo - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (37,5)-(37,9)) - │ │ ├── operator_loc: (37,5)-(37,6) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (37,6)-(37,9)) - │ │ ├── name: :bar - │ │ └── depth: 0 + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (37,0)-(37,3)) + │ │ ├── name: :foo + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (37,5)-(37,9)) + │ │ ├── operator_loc: (37,5)-(37,6) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (37,6)-(37,9)) + │ │ ├── name: :bar + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (37,10)-(37,11) = "=" @@ -223,20 +235,24 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ ├── @ MultiWriteNode (location: (39,0)-(39,27)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (39,0)-(39,3)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ MultiTargetNode (location: (39,5)-(39,15)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (39,6)-(39,9)) │ │ │ │ ├── name: :bar │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (39,11)-(39,14)) │ │ │ ├── name: :baz │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: (39,5)-(39,6) = "(" │ │ └── rparen_loc: (39,14)-(39,15) = ")" + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (39,16)-(39,17) = "=" diff --git a/test/prism/snapshots/whitequark/and_or_masgn.txt b/test/prism/snapshots/whitequark/and_or_masgn.txt index 370fa32afa..2add522f65 100644 --- a/test/prism/snapshots/whitequark/and_or_masgn.txt +++ b/test/prism/snapshots/whitequark/and_or_masgn.txt @@ -21,13 +21,15 @@ │ │ │ @ StatementsNode (location: (1,8)-(1,18)) │ │ │ └── body: (length: 1) │ │ │ └── @ MultiWriteNode (location: (1,8)-(1,18)) - │ │ │ ├── targets: (length: 2) + │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ LocalVariableTargetNode (location: (1,8)-(1,9)) │ │ │ │ │ ├── name: :a │ │ │ │ │ └── depth: 0 │ │ │ │ └── @ LocalVariableTargetNode (location: (1,11)-(1,12)) │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) │ │ │ ├── lparen_loc: ∅ │ │ │ ├── rparen_loc: ∅ │ │ │ ├── operator_loc: (1,13)-(1,14) = "=" @@ -63,13 +65,15 @@ │ │ @ StatementsNode (location: (3,8)-(3,18)) │ │ └── body: (length: 1) │ │ └── @ MultiWriteNode (location: (3,8)-(3,18)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (3,8)-(3,9)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (3,11)-(3,12)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (3,13)-(3,14) = "=" diff --git a/test/prism/snapshots/whitequark/cond_begin_masgn.txt b/test/prism/snapshots/whitequark/cond_begin_masgn.txt index e30a3989f4..9650a94d8b 100644 --- a/test/prism/snapshots/whitequark/cond_begin_masgn.txt +++ b/test/prism/snapshots/whitequark/cond_begin_masgn.txt @@ -21,13 +21,15 @@ │ │ │ ├── flags: variable_call │ │ │ └── name: :bar │ │ └── @ MultiWriteNode (location: (1,9)-(1,19)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,9)-(1,10)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,12)-(1,13)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (1,14)-(1,15) = "=" diff --git a/test/prism/snapshots/whitequark/for_mlhs.txt b/test/prism/snapshots/whitequark/for_mlhs.txt index 27d201a689..2961335b54 100644 --- a/test/prism/snapshots/whitequark/for_mlhs.txt +++ b/test/prism/snapshots/whitequark/for_mlhs.txt @@ -6,13 +6,15 @@ └── @ ForNode (location: (1,0)-(1,28)) ├── index: │ @ MultiTargetNode (location: (1,4)-(1,8)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ │ ├── name: :a │ │ │ └── depth: 1 │ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ │ ├── name: :b │ │ └── depth: 1 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ └── rparen_loc: ∅ ├── collection: diff --git a/test/prism/snapshots/whitequark/if_masgn__24.txt b/test/prism/snapshots/whitequark/if_masgn__24.txt index bcd74cc067..5d6e698177 100644 --- a/test/prism/snapshots/whitequark/if_masgn__24.txt +++ b/test/prism/snapshots/whitequark/if_masgn__24.txt @@ -11,13 +11,15 @@ │ │ @ StatementsNode (location: (1,4)-(1,14)) │ │ └── body: (length: 1) │ │ └── @ MultiWriteNode (location: (1,4)-(1,14)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (1,9)-(1,10) = "=" diff --git a/test/prism/snapshots/whitequark/masgn.txt b/test/prism/snapshots/whitequark/masgn.txt index e62f8e4ca7..3da7c06274 100644 --- a/test/prism/snapshots/whitequark/masgn.txt +++ b/test/prism/snapshots/whitequark/masgn.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(5,20)) └── body: (length: 3) ├── @ MultiWriteNode (location: (1,0)-(1,17)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,4)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (1,6)-(1,9)) │ │ ├── name: :bar │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (1,0)-(1,1) = "(" │ ├── rparen_loc: (1,9)-(1,10) = ")" │ ├── operator_loc: (1,11)-(1,12) = "=" @@ -24,13 +26,15 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ ├── @ MultiWriteNode (location: (3,0)-(3,15)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,3)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (3,5)-(3,8)) │ │ ├── name: :bar │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (3,9)-(3,10) = "=" @@ -44,7 +48,7 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ └── @ MultiWriteNode (location: (5,0)-(5,20)) - ├── targets: (length: 3) + ├── requireds: (length: 3) │ ├── @ LocalVariableTargetNode (location: (5,0)-(5,3)) │ │ ├── name: :foo │ │ └── depth: 0 @@ -54,6 +58,8 @@ │ └── @ LocalVariableTargetNode (location: (5,10)-(5,13)) │ ├── name: :baz │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (5,14)-(5,15) = "=" diff --git a/test/prism/snapshots/whitequark/masgn_attr.txt b/test/prism/snapshots/whitequark/masgn_attr.txt index 0280897b7b..d12ce590e3 100644 --- a/test/prism/snapshots/whitequark/masgn_attr.txt +++ b/test/prism/snapshots/whitequark/masgn_attr.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(5,18)) └── body: (length: 3) ├── @ MultiWriteNode (location: (1,0)-(1,17)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (1,0)-(1,6)) │ │ │ ├── receiver: │ │ │ │ @ SelfNode (location: (1,0)-(1,4)) @@ -19,6 +19,8 @@ │ │ └── @ LocalVariableTargetNode (location: (1,8)-(1,11)) │ │ ├── name: :foo │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (1,12)-(1,13) = "=" @@ -27,7 +29,7 @@ │ ├── name: :foo │ └── depth: 0 ├── @ MultiWriteNode (location: (3,0)-(3,24)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ CallNode (location: (3,0)-(3,6)) │ │ │ ├── receiver: │ │ │ │ @ SelfNode (location: (3,0)-(3,4)) @@ -57,6 +59,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (3,19)-(3,20) = "=" @@ -65,7 +69,7 @@ │ ├── name: :foo │ └── depth: 0 └── @ MultiWriteNode (location: (5,0)-(5,18)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ CallNode (location: (5,0)-(5,7)) │ │ ├── receiver: │ │ │ @ SelfNode (location: (5,0)-(5,4)) @@ -80,6 +84,8 @@ │ └── @ LocalVariableTargetNode (location: (5,9)-(5,12)) │ ├── name: :foo │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (5,13)-(5,14) = "=" diff --git a/test/prism/snapshots/whitequark/masgn_cmd.txt b/test/prism/snapshots/whitequark/masgn_cmd.txt index a671ec8d38..ecf91b0c49 100644 --- a/test/prism/snapshots/whitequark/masgn_cmd.txt +++ b/test/prism/snapshots/whitequark/masgn_cmd.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,16)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,16)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) │ │ ├── name: :foo │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) │ ├── name: :bar │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,9)-(1,10) = "=" diff --git a/test/prism/snapshots/whitequark/masgn_const.txt b/test/prism/snapshots/whitequark/masgn_const.txt index 3cd8f13a78..6090566161 100644 --- a/test/prism/snapshots/whitequark/masgn_const.txt +++ b/test/prism/snapshots/whitequark/masgn_const.txt @@ -4,7 +4,7 @@ @ StatementsNode (location: (1,0)-(3,18)) └── body: (length: 2) ├── @ MultiWriteNode (location: (1,0)-(1,14)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ ConstantPathTargetNode (location: (1,0)-(1,3)) │ │ │ ├── parent: ∅ │ │ │ ├── child: @@ -14,6 +14,8 @@ │ │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) │ │ ├── name: :foo │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (1,9)-(1,10) = "=" @@ -22,7 +24,7 @@ │ ├── name: :foo │ └── depth: 0 └── @ MultiWriteNode (location: (3,0)-(3,18)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ ConstantPathTargetNode (location: (3,0)-(3,7)) │ │ ├── parent: │ │ │ @ SelfNode (location: (3,0)-(3,4)) @@ -33,6 +35,8 @@ │ └── @ LocalVariableTargetNode (location: (3,9)-(3,12)) │ ├── name: :foo │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (3,13)-(3,14) = "=" diff --git a/test/prism/snapshots/whitequark/masgn_nested.txt b/test/prism/snapshots/whitequark/masgn_nested.txt index 45e05e574d..e86c8de000 100644 --- a/test/prism/snapshots/whitequark/masgn_nested.txt +++ b/test/prism/snapshots/whitequark/masgn_nested.txt @@ -4,17 +4,21 @@ @ StatementsNode (location: (1,0)-(3,15)) └── body: (length: 2) ├── @ MultiWriteNode (location: (1,0)-(1,13)) - │ ├── targets: (length: 1) + │ ├── requireds: (length: 1) │ │ └── @ MultiTargetNode (location: (1,1)-(1,6)) - │ │ ├── targets: (length: 2) - │ │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) - │ │ │ │ ├── name: :b - │ │ │ │ └── depth: 0 - │ │ │ └── @ SplatNode (location: (1,3)-(1,4)) - │ │ │ ├── operator_loc: (1,3)-(1,4) = "," - │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (1,2)-(1,3)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── rest: + │ │ │ @ SplatNode (location: (1,3)-(1,4)) + │ │ │ ├── operator_loc: (1,3)-(1,4) = "," + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: (1,1)-(1,2) = "(" │ │ └── rparen_loc: (1,5)-(1,6) = ")" + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (1,0)-(1,1) = "(" │ ├── rparen_loc: (1,6)-(1,7) = ")" │ ├── operator_loc: (1,8)-(1,9) = "=" @@ -30,20 +34,24 @@ │ ├── flags: variable_call │ └── name: :foo └── @ MultiWriteNode (location: (3,0)-(3,15)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ MultiTargetNode (location: (3,3)-(3,9)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (3,4)-(3,5)) │ │ │ ├── name: :b │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (3,7)-(3,8)) │ │ ├── name: :c │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: (3,3)-(3,4) = "(" │ └── rparen_loc: (3,8)-(3,9) = ")" + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (3,10)-(3,11) = "=" diff --git a/test/prism/snapshots/whitequark/masgn_splat.txt b/test/prism/snapshots/whitequark/masgn_splat.txt index a818fc141d..f496124b07 100644 --- a/test/prism/snapshots/whitequark/masgn_splat.txt +++ b/test/prism/snapshots/whitequark/masgn_splat.txt @@ -4,10 +4,12 @@ @ StatementsNode (location: (1,0)-(19,16)) └── body: (length: 10) ├── @ MultiWriteNode (location: (1,0)-(1,7)) - │ ├── targets: (length: 1) - │ │ └── @ SplatNode (location: (1,0)-(1,1)) - │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ └── expression: ∅ + │ ├── requireds: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (1,0)-(1,1)) + │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (1,2)-(1,3) = "=" @@ -23,12 +25,14 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (3,0)-(3,13)) - │ ├── targets: (length: 3) + │ ├── requireds: (length: 3) │ │ ├── @ MultiTargetNode (location: (3,0)-(3,1)) - │ │ │ ├── targets: (length: 1) - │ │ │ │ └── @ SplatNode (location: (3,0)-(3,1)) - │ │ │ │ ├── operator_loc: (3,0)-(3,1) = "*" - │ │ │ │ └── expression: ∅ + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (3,0)-(3,1)) + │ │ │ │ ├── operator_loc: (3,0)-(3,1) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (length: 0) │ │ │ ├── lparen_loc: ∅ │ │ │ └── rparen_loc: ∅ │ │ ├── @ LocalVariableTargetNode (location: (3,3)-(3,4)) @@ -37,6 +41,8 @@ │ │ └── @ LocalVariableTargetNode (location: (3,6)-(3,7)) │ │ ├── name: :d │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (3,8)-(3,9) = "=" @@ -52,13 +58,15 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (5,0)-(5,8)) - │ ├── targets: (length: 1) - │ │ └── @ SplatNode (location: (5,0)-(5,2)) - │ │ ├── operator_loc: (5,0)-(5,1) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (5,1)-(5,2)) - │ │ ├── name: :b - │ │ └── depth: 0 + │ ├── requireds: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (5,0)-(5,2)) + │ │ ├── operator_loc: (5,0)-(5,1) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (5,1)-(5,2)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (5,3)-(5,4) = "=" @@ -74,20 +82,24 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (7,0)-(7,11)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ MultiTargetNode (location: (7,0)-(7,2)) - │ │ │ ├── targets: (length: 1) - │ │ │ │ └── @ SplatNode (location: (7,0)-(7,2)) - │ │ │ │ ├── operator_loc: (7,0)-(7,1) = "*" - │ │ │ │ └── expression: - │ │ │ │ @ LocalVariableTargetNode (location: (7,1)-(7,2)) - │ │ │ │ ├── name: :b - │ │ │ │ └── depth: 0 + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (7,0)-(7,2)) + │ │ │ │ ├── operator_loc: (7,0)-(7,1) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (7,1)-(7,2)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── posts: (length: 0) │ │ │ ├── lparen_loc: ∅ │ │ │ └── rparen_loc: ∅ │ │ └── @ LocalVariableTargetNode (location: (7,4)-(7,5)) │ │ ├── name: :c │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (7,6)-(7,7) = "=" @@ -103,11 +115,13 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (9,0)-(9,18)) - │ ├── targets: (length: 2) + │ ├── requireds: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (9,0)-(9,4)) │ │ │ └── name: :@foo │ │ └── @ ClassVariableTargetNode (location: (9,6)-(9,11)) │ │ └── name: :@@bar + │ ├── rest: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (9,12)-(9,13) = "=" @@ -130,13 +144,15 @@ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ ├── @ MultiWriteNode (location: (11,0)-(11,10)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (11,0)-(11,1)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (11,3)-(11,4)) - │ │ ├── operator_loc: (11,3)-(11,4) = "*" - │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (11,0)-(11,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (11,3)-(11,4)) + │ │ ├── operator_loc: (11,3)-(11,4) = "*" + │ │ └── expression: ∅ + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (11,5)-(11,6) = "=" @@ -152,13 +168,15 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (13,0)-(13,13)) - │ ├── targets: (length: 3) - │ │ ├── @ LocalVariableTargetNode (location: (13,0)-(13,1)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ ├── @ SplatNode (location: (13,3)-(13,4)) - │ │ │ ├── operator_loc: (13,3)-(13,4) = "*" - │ │ │ └── expression: ∅ + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (13,0)-(13,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (13,3)-(13,4)) + │ │ ├── operator_loc: (13,3)-(13,4) = "*" + │ │ └── expression: ∅ + │ ├── posts: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (13,6)-(13,7)) │ │ ├── name: :c │ │ └── depth: 0 @@ -177,16 +195,18 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (15,0)-(15,11)) - │ ├── targets: (length: 2) - │ │ ├── @ LocalVariableTargetNode (location: (15,0)-(15,1)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ └── @ SplatNode (location: (15,3)-(15,5)) - │ │ ├── operator_loc: (15,3)-(15,4) = "*" - │ │ └── expression: - │ │ @ LocalVariableTargetNode (location: (15,4)-(15,5)) - │ │ ├── name: :b - │ │ └── depth: 0 + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (15,0)-(15,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (15,3)-(15,5)) + │ │ ├── operator_loc: (15,3)-(15,4) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (15,4)-(15,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── posts: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (15,6)-(15,7) = "=" @@ -202,16 +222,18 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (17,0)-(17,14)) - │ ├── targets: (length: 3) - │ │ ├── @ LocalVariableTargetNode (location: (17,0)-(17,1)) - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ ├── @ SplatNode (location: (17,3)-(17,5)) - │ │ │ ├── operator_loc: (17,3)-(17,4) = "*" - │ │ │ └── expression: - │ │ │ @ LocalVariableTargetNode (location: (17,4)-(17,5)) - │ │ │ ├── name: :b - │ │ │ └── depth: 0 + │ ├── requireds: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (17,0)-(17,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── rest: + │ │ @ SplatNode (location: (17,3)-(17,5)) + │ │ ├── operator_loc: (17,3)-(17,4) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (17,4)-(17,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── posts: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (17,7)-(17,8)) │ │ ├── name: :c │ │ └── depth: 0 @@ -230,13 +252,15 @@ │ ├── flags: variable_call │ └── name: :bar └── @ MultiWriteNode (location: (19,0)-(19,16)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (19,0)-(19,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (19,3)-(19,4)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (19,5)-(19,6) = "=" diff --git a/test/prism/snapshots/whitequark/not_masgn__24.txt b/test/prism/snapshots/whitequark/not_masgn__24.txt index 3ca00981a3..afe5bc341c 100644 --- a/test/prism/snapshots/whitequark/not_masgn__24.txt +++ b/test/prism/snapshots/whitequark/not_masgn__24.txt @@ -10,13 +10,15 @@ │ │ @ StatementsNode (location: (1,2)-(1,12)) │ │ └── body: (length: 1) │ │ └── @ MultiWriteNode (location: (1,2)-(1,12)) - │ │ ├── targets: (length: 2) + │ │ ├── requireds: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,5)-(1,6)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/whitequark/rescue_mod_masgn.txt b/test/prism/snapshots/whitequark/rescue_mod_masgn.txt index c7d96c45c2..e44a4adacd 100644 --- a/test/prism/snapshots/whitequark/rescue_mod_masgn.txt +++ b/test/prism/snapshots/whitequark/rescue_mod_masgn.txt @@ -4,13 +4,15 @@ @ StatementsNode (location: (1,0)-(1,29)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,29)) - ├── targets: (length: 2) + ├── requireds: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) │ │ ├── name: :foo │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) │ ├── name: :bar │ └── depth: 0 + ├── rest: ∅ + ├── posts: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,9)-(1,10) = "=" |