diff --git a/config.yml b/config.yml index 1d193e9ae63..2f187d32610 100644 --- a/config.yml +++ b/config.yml @@ -1922,7 +1922,11 @@ nodes: ^^^^^^^^^^^^^^ - name: MultiTargetNode fields: - - name: targets + - name: lefts + type: node[] + - name: rest + type: node? + - name: rights type: node[] - name: lparen_loc type: location? @@ -1935,7 +1939,11 @@ nodes: ^^^^^^ - name: MultiWriteNode fields: - - name: targets + - name: lefts + type: node[] + - name: rest + type: node? + - name: rights type: node[] - name: lparen_loc type: location? @@ -2176,20 +2184,6 @@ nodes: /foo/i ^^^^^^ - - name: RequiredDestructuredParameterNode - fields: - - name: parameters - type: node[] - - name: opening_loc - type: location - - name: closing_loc - type: location - comment: | - Represents a destructured required parameter node. - - def foo((bar, baz)) - ^^^^^^^^^^ - end - name: RequiredParameterNode fields: - name: name diff --git a/include/prism/parser.h b/include/prism/parser.h index f77d8818aae..c701e595a9f 100644 --- a/include/prism/parser.h +++ b/include/prism/parser.h @@ -212,6 +212,7 @@ typedef enum { PM_CONTEXT_EMBEXPR, // an interpolated expression PM_CONTEXT_ENSURE, // an ensure statement PM_CONTEXT_FOR, // a for loop + PM_CONTEXT_FOR_INDEX, // a for loop's index PM_CONTEXT_IF, // an if statement PM_CONTEXT_LAMBDA_BRACES, // a lambda expression with braces PM_CONTEXT_LAMBDA_DO_END, // a lambda expression with do..end diff --git a/lib/prism/debug.rb b/lib/prism/debug.rb index 6a68a3d33e3..7589dff16b6 100644 --- a/lib/prism/debug.rb +++ b/lib/prism/debug.rb @@ -110,11 +110,13 @@ def self.prism_locals(source) # Recurse down the parameter tree to find any destructured # parameters and add them after the other parameters. - param_stack = params.requireds.concat(params.posts).grep(RequiredDestructuredParameterNode).reverse + param_stack = params.requireds.concat(params.posts).grep(MultiTargetNode).reverse while (param = param_stack.pop) case param - when RequiredDestructuredParameterNode - param_stack.concat(param.parameters.reverse) + when MultiTargetNode + param_stack.concat(param.rights.reverse) + param_stack << param.rest + param_stack.concat(param.lefts.reverse) when RequiredParameterNode sorted << param.name when SplatNode diff --git a/src/prism.c b/src/prism.c index d8977d2dfd5..05c425864a0 100644 --- a/src/prism.c +++ b/src/prism.c @@ -40,6 +40,7 @@ debug_context(pm_context_t context) { case PM_CONTEXT_BLOCK_BRACES: return "BLOCK_BRACES"; case PM_CONTEXT_BLOCK_KEYWORDS: return "BLOCK_KEYWORDS"; case PM_CONTEXT_FOR: return "FOR"; + case PM_CONTEXT_FOR_INDEX: return "FOR_INDEX"; case PM_CONTEXT_IF: return "IF"; case PM_CONTEXT_MAIN: return "MAIN"; case PM_CONTEXT_MODULE: return "MODULE"; @@ -3611,7 +3612,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, + .lefts = PM_EMPTY_NODE_LIST, + .rest = NULL, + .rights = PM_EMPTY_NODE_LIST, .lparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .rparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE }; @@ -3621,8 +3624,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->rights, target); + } + } else if (node->rest == NULL) { + pm_node_list_append(&node->lefts, target); + } else { + pm_node_list_append(&node->rights, target); + } if (node->base.location.start == NULL || (node->base.location.start > target->location.start)) { node->base.location.start = target->location.start; @@ -3633,6 +3647,20 @@ pm_multi_target_node_targets_append(pm_multi_target_node_t *node, pm_node_t *tar } } +// Set the opening of a MultiTargetNode node. +static void +pm_multi_target_node_opening_set(pm_multi_target_node_t *node, const pm_token_t *lparen) { + node->base.location.start = lparen->start; + node->lparen_loc = PM_LOCATION_TOKEN_VALUE(lparen); +} + +// Set the closing of a MultiTargetNode node. +static void +pm_multi_target_node_closing_set(pm_multi_target_node_t *node, const pm_token_t *rparen) { + node->base.location.end = rparen->end; + node->rparen_loc = PM_LOCATION_TOKEN_VALUE(rparen); +} + // Allocate a new MultiWriteNode node. static pm_multi_write_node_t * pm_multi_write_node_create(pm_parser_t *parser, pm_multi_target_node_t *target, const pm_token_t *operator, pm_node_t *value) { @@ -3646,7 +3674,9 @@ pm_multi_write_node_create(pm_parser_t *parser, pm_multi_target_node_t *target, .end = value->location.end } }, - .targets = target->targets, + .lefts = target->lefts, + .rest = target->rest, + .rights = target->rights, .lparen_loc = target->lparen_loc, .rparen_loc = target->rparen_loc, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4073,37 +4103,6 @@ pm_regular_expression_node_create(pm_parser_t *parser, const pm_token_t *opening return pm_regular_expression_node_create_unescaped(parser, opening, content, closing, &PM_EMPTY_STRING); } -// Allocate a new RequiredDestructuredParameterNode node. -static pm_required_destructured_parameter_node_t * -pm_required_destructured_parameter_node_create(pm_parser_t *parser, const pm_token_t *opening) { - pm_required_destructured_parameter_node_t *node = PM_ALLOC_NODE(parser, pm_required_destructured_parameter_node_t); - - *node = (pm_required_destructured_parameter_node_t) { - { - .type = PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE, - .location = PM_LOCATION_TOKEN_VALUE(opening) - }, - .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .parameters = PM_EMPTY_NODE_LIST - }; - - return node; -} - -// Append a new parameter to the given RequiredDestructuredParameterNode node. -static void -pm_required_destructured_parameter_node_append_parameter(pm_required_destructured_parameter_node_t *node, pm_node_t *parameter) { - pm_node_list_append(&node->parameters, parameter); -} - -// Set the closing token of the given RequiredDestructuredParameterNode node. -static void -pm_required_destructured_parameter_node_closing_set(pm_required_destructured_parameter_node_t *node, const pm_token_t *closing) { - node->closing_loc = PM_LOCATION_TOKEN_VALUE(closing); - node->base.location.end = closing->end; -} - // Allocate a new RequiredParameterNode node. static pm_required_parameter_node_t * pm_required_parameter_node_create(pm_parser_t *parser, const pm_token_t *token) { @@ -5587,6 +5586,8 @@ context_terminator(pm_context_t context, pm_token_t *token) { case PM_CONTEXT_FOR: case PM_CONTEXT_ENSURE: return token->type == PM_TOKEN_KEYWORD_END; + case PM_CONTEXT_FOR_INDEX: + return token->type == PM_TOKEN_KEYWORD_IN; case PM_CONTEXT_CASE_WHEN: return token->type == PM_TOKEN_KEYWORD_WHEN || token->type == PM_TOKEN_KEYWORD_END || token->type == PM_TOKEN_KEYWORD_ELSE; case PM_CONTEXT_CASE_IN: @@ -9491,10 +9492,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target) { splat->expression = parse_target(parser, splat->expression); } - 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); - - return (pm_node_t *) multi_target; + return (pm_node_t *) splat; } case PM_CALL_NODE: { pm_call_node_t *call = (pm_call_node_t *) target; @@ -9570,7 +9568,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target) { } } -// Parse a write targets and validate that it is in a valid position for +// Parse a write target and validate that it is in a valid position for // assignment. static pm_node_t * parse_target_validate(pm_parser_t *parser, pm_node_t *target) { @@ -9641,7 +9639,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 +9755,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 +9775,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); - } else { + pm_multi_target_node_targets_append(parser, result, target); + } else if (!match1(parser, PM_TOKEN_EOF)) { // 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; } } @@ -10179,34 +10177,27 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for // end // // It can recurse infinitely down, and splats are allowed to group arguments. -static pm_required_destructured_parameter_node_t * +static pm_multi_target_node_t * parse_required_destructured_parameter(pm_parser_t *parser) { expect1(parser, PM_TOKEN_PARENTHESIS_LEFT, PM_ERR_EXPECT_LPAREN_REQ_PARAMETER); - pm_token_t opening = parser->previous; - pm_required_destructured_parameter_node_t *node = pm_required_destructured_parameter_node_create(parser, &opening); - bool parsed_splat = false; + pm_multi_target_node_t *node = pm_multi_target_node_create(parser); + pm_multi_target_node_opening_set(node, &parser->previous); do { pm_node_t *param; - if (node->parameters.size > 0 && match1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { - if (parsed_splat) { - pm_parser_err_previous(parser, PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT); - } - + // If we get here then we have a trailing comma. In this case we'll + // create an implicit splat node. + if (node->lefts.size > 0 && match1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { param = (pm_node_t *) pm_splat_node_create(parser, &parser->previous, NULL); - pm_required_destructured_parameter_node_append_parameter(node, param); + pm_multi_target_node_targets_append(parser, node, param); break; } if (match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { param = (pm_node_t *) parse_required_destructured_parameter(parser); } else if (accept1(parser, PM_TOKEN_USTAR)) { - if (parsed_splat) { - pm_parser_err_previous(parser, PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT); - } - pm_token_t star = parser->previous; pm_node_t *value = NULL; @@ -10218,7 +10209,6 @@ parse_required_destructured_parameter(pm_parser_t *parser) { } param = (pm_node_t *) pm_splat_node_create(parser, &star, value); - parsed_splat = true; } else { expect1(parser, PM_TOKEN_IDENTIFIER, PM_ERR_EXPECT_IDENT_REQ_PARAMETER); pm_token_t name = parser->previous; @@ -10228,11 +10218,11 @@ parse_required_destructured_parameter(pm_parser_t *parser) { pm_parser_local_add_token(parser, &name); } - pm_required_destructured_parameter_node_append_parameter(node, param); + pm_multi_target_node_targets_append(parser, node, param); } while (accept1(parser, PM_TOKEN_COMMA)); expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_EXPECT_RPAREN_REQ_PARAMETER); - pm_required_destructured_parameter_node_closing_set(node, &parser->previous); + pm_multi_target_node_closing_set(node, &parser->previous); return node; } @@ -12508,16 +12498,17 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) { parser_lex(parser); pm_accepts_block_stack_pop(parser); - // If we have a single statement and are ending on a right - // parenthesis, then we need to check if this is possibly a - // multiple target node. - if (PM_NODE_TYPE_P(statement, PM_MULTI_TARGET_NODE)) { + if (PM_NODE_TYPE_P(statement, PM_MULTI_TARGET_NODE) || PM_NODE_TYPE_P(statement, PM_SPLAT_NODE)) { + // If we have a single statement and are ending on a right + // parenthesis, then we need to check if this is possibly a + // multiple target node. pm_multi_target_node_t *multi_target; - if (((pm_multi_target_node_t *) statement)->lparen_loc.start == NULL) { + + if (PM_NODE_TYPE_P(statement, PM_MULTI_TARGET_NODE) && ((pm_multi_target_node_t *) statement)->lparen_loc.start == NULL) { 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); @@ -12529,10 +12520,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) { multi_target->base.location.end = rparen_loc.end; if (match1(parser, PM_TOKEN_COMMA)) { - return parse_targets_validate(parser, (pm_node_t *) multi_target, PM_BINDING_POWER_INDEX); - } else { - return parse_target_validate(parser, (pm_node_t *) multi_target); + if (binding_power == PM_BINDING_POWER_STATEMENT) { + return parse_targets_validate(parser, (pm_node_t *) multi_target, PM_BINDING_POWER_INDEX); + } + return (pm_node_t *) multi_target; } + + return parse_target_validate(parser, (pm_node_t *) multi_target); } // If we have a single statement and are ending on a right parenthesis @@ -13619,7 +13613,9 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) { parser_lex(parser); pm_token_t for_keyword = parser->previous; pm_node_t *index; + pm_parser_scope_push_transparent(parser); + context_push(parser, PM_CONTEXT_FOR_INDEX); // First, parse out the first index expression. if (accept1(parser, PM_TOKEN_USTAR)) { @@ -13645,6 +13641,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) { index = parse_target(parser, index); } + context_pop(parser); pm_parser_scope_pop(parser); pm_do_loop_stack_push(parser, true); @@ -14551,18 +14548,13 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t return parse_write(parser, node, &token, value); } case PM_SPLAT_NODE: { - pm_splat_node_t *splat_node = (pm_splat_node_t *) node; + pm_multi_target_node_t *multi_target = pm_multi_target_node_create(parser); + pm_multi_target_node_targets_append(parser, multi_target, node); - switch (PM_NODE_TYPE(splat_node->expression)) { - case PM_CASE_WRITABLE: - parser_lex(parser); - pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL); - return parse_write(parser, (pm_node_t *) splat_node, &token, value); - default: - break; - } + parser_lex(parser); + pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL); + return parse_write(parser, (pm_node_t *) multi_target, &token, value); } - /* fallthrough */ default: parser_lex(parser); diff --git a/test/prism/constant_path_node_test.rb b/test/prism/constant_path_node_test.rb index 1a44fbaba5b..5bb98306879 100644 --- a/test/prism/constant_path_node_test.rb +++ b/test/prism/constant_path_node_test.rb @@ -23,8 +23,7 @@ def test_full_name_for_constant_path_target 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.lefts.first.full_name) end end end diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 6cf501c4c16..e08c2f744d2 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -1202,7 +1202,7 @@ def test_unterminated_global_variable def test_invalid_global_variable_write assert_errors expression("$',"), "$',", [ ["Immutable variable as a write target", 0..2], - ["Unexpected write target", 0..3] + ["Unexpected write target", 0..2] ] end diff --git a/test/prism/fixtures/variables.txt b/test/prism/fixtures/variables.txt index 276dc3b3f1e..1545c30c80f 100644 --- a/test/prism/fixtures/variables.txt +++ b/test/prism/fixtures/variables.txt @@ -44,3 +44,4 @@ Foo = 1, 2 (a; b; c) +a, (b, c), d = [] diff --git a/test/prism/location_test.rb b/test/prism/location_test.rb index 25af1f76181..5501d9de4a3 100644 --- a/test/prism/location_test.rb +++ b/test/prism/location_test.rb @@ -224,7 +224,7 @@ def test_ClassVariableReadNode def test_ClassVariableTargetNode assert_location(ClassVariableTargetNode, "@@foo, @@bar = baz", 0...5) do |node| - node.targets.first + node.lefts.first end end @@ -252,7 +252,7 @@ def test_ConstantPathOrWriteNode def test_ConstantPathTargetNode assert_location(ConstantPathTargetNode, "::Foo, ::Bar = baz", 0...5) do |node| - node.targets.first + node.lefts.first end end @@ -281,7 +281,7 @@ def test_ConstantReadNode def test_ConstantTargetNode assert_location(ConstantTargetNode, "Foo, Bar = baz", 0...3) do |node| - node.targets.first + node.lefts.first end end @@ -379,7 +379,7 @@ def test_GlobalVariableReadNode def test_GlobalVariableTargetNode assert_location(GlobalVariableTargetNode, "$foo, $bar = baz", 0...4) do |node| - node.targets.first + node.lefts.first end end @@ -457,7 +457,7 @@ def test_InstanceVariableReadNode def test_InstanceVariableTargetNode assert_location(InstanceVariableTargetNode, "@foo, @bar = baz", 0...4) do |node| - node.targets.first + node.lefts.first end end @@ -548,7 +548,7 @@ def test_LocalVariableReadNode def test_LocalVariableTargetNode assert_location(LocalVariableTargetNode, "foo, bar = baz", 0...3) do |node| - node.targets.first + node.lefts.first end end @@ -578,7 +578,10 @@ def test_ModuleNode 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.lefts.last } + assert_location(MultiTargetNode, "def foo((bar)); end", 8...13) do |node| + node.parameters.requireds.first + end end def test_MultiWriteNode @@ -676,12 +679,6 @@ def test_RequiredParameterNode end end - def test_RequiredDestructuredParameterNode - assert_location(RequiredDestructuredParameterNode, "def foo((bar)); end", 8...13) do |node| - node.parameters.requireds.first - end - end - def test_RescueNode code = <<~RUBY begin @@ -736,7 +733,7 @@ def test_SourceLineNode 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 2440f512fdd..bf68329ca0d 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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (41,0)-(41,6)) │ │ │ ├── receiver: │ │ │ │ @ CallNode (location: (41,0)-(41,3)) @@ -458,6 +458,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── rights: (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 edad357379e..28225efd549 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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (7,4)-(7,5)) │ │ │ │ ├── name: :i │ │ │ │ └── depth: 1 │ │ │ └── @ LocalVariableTargetNode (location: (7,6)-(7,7)) │ │ │ ├── name: :j │ │ │ └── depth: 1 + │ │ ├── rest: ∅ + │ │ ├── rights: (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) + │ │ ├── lefts: (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: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: ∅ │ │ └── rparen_loc: ∅ │ ├── collection: diff --git a/test/prism/snapshots/method_calls.txt b/test/prism/snapshots/method_calls.txt index 8704f58f0fd..7981b504227 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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (41,0)-(41,7)) │ │ │ ├── receiver: │ │ │ │ @ CallNode (location: (41,0)-(41,3)) @@ -540,6 +540,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :bar= + │ ├── rest: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (41,17)-(41,18) = "=" diff --git a/test/prism/snapshots/methods.txt b/test/prism/snapshots/methods.txt index f3a09bb096a..abe050cd8c1 100644 --- a/test/prism/snapshots/methods.txt +++ b/test/prism/snapshots/methods.txt @@ -10,14 +10,16 @@ │ ├── parameters: │ │ @ ParametersNode (location: (1,8)-(1,18)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,18)) - │ │ │ ├── parameters: (length: 2) + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,12)) │ │ │ │ │ └── name: :bar │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) │ │ │ │ └── name: :baz - │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ └── closing_loc: (1,17)-(1,18) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_loc: (1,17)-(1,18) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -39,14 +41,16 @@ │ ├── parameters: │ │ @ ParametersNode (location: (4,8)-(4,44)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (4,8)-(4,18)) - │ │ │ ├── parameters: (length: 2) + │ │ │ └── @ MultiTargetNode (location: (4,8)-(4,18)) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (4,9)-(4,12)) │ │ │ │ │ └── name: :bar │ │ │ │ └── @ RequiredParameterNode (location: (4,14)-(4,17)) │ │ │ │ └── name: :baz - │ │ │ ├── opening_loc: (4,8)-(4,9) = "(" - │ │ │ └── closing_loc: (4,17)-(4,18) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (4,8)-(4,9) = "(" + │ │ │ └── rparen_loc: (4,17)-(4,18) = ")" │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (4,20)-(4,32)) │ │ │ ├── name: :optional @@ -57,14 +61,16 @@ │ │ │ └── flags: decimal │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (4,34)-(4,44)) - │ │ │ ├── parameters: (length: 2) + │ │ │ └── @ MultiTargetNode (location: (4,34)-(4,44)) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (4,35)-(4,38)) │ │ │ │ │ └── name: :bin │ │ │ │ └── @ RequiredParameterNode (location: (4,40)-(4,43)) │ │ │ │ └── name: :bag - │ │ │ ├── opening_loc: (4,34)-(4,35) = "(" - │ │ │ └── closing_loc: (4,43)-(4,44) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (4,34)-(4,35) = "(" + │ │ │ └── rparen_loc: (4,43)-(4,44) = ")" │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ diff --git a/test/prism/snapshots/procs.txt b/test/prism/snapshots/procs.txt index f217e9bd334..a711c5551e9 100644 --- a/test/prism/snapshots/procs.txt +++ b/test/prism/snapshots/procs.txt @@ -352,14 +352,16 @@ │ ├── parameters: │ │ @ ParametersNode (location: (27,4)-(27,14)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (27,4)-(27,10)) - │ │ │ ├── parameters: (length: 2) + │ │ │ └── @ MultiTargetNode (location: (27,4)-(27,10)) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (27,5)-(27,6)) │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (27,8)-(27,9)) │ │ │ │ └── name: :b - │ │ │ ├── opening_loc: (27,4)-(27,5) = "(" - │ │ │ └── closing_loc: (27,9)-(27,10) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (27,4)-(27,5) = "(" + │ │ │ └── rparen_loc: (27,9)-(27,10) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (27,12)-(27,14)) diff --git a/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt index 8fc59bfa48b..671e3c4ee5e 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -18,15 +18,17 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,11)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ SplatNode (location: (1,6)-(1,7)) - │ │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" - │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ └── name: :a - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt index 3232960ae03..ce92bd6a2e5 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -18,15 +18,17 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,11)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,10)) - │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ └── expression: ∅ - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt index 66364526a1d..67439e5e53b 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -18,19 +18,21 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,15)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,15)) - │ │ │ │ ├── parameters: (length: 3) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) - │ │ │ │ │ │ └── name: :a - │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,11)) - │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ │ └── expression: - │ │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) - │ │ │ │ │ │ └── name: :b + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/block_decomp_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_splat.txt index 5c17e68914b..5de498cac90 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_splat.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_splat.txt @@ -18,15 +18,17 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,9)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,9)) - │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ └── @ SplatNode (location: (1,6)-(1,8)) - │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) - │ │ │ │ │ └── name: :a - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,8)-(1,9) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,9)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,6)-(1,8)) + │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,8)-(1,9) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/block_paren_splat.txt b/test/prism/snapshots/seattlerb/block_paren_splat.txt index a0f8a74bd44..5782874d6d9 100644 --- a/test/prism/snapshots/seattlerb/block_paren_splat.txt +++ b/test/prism/snapshots/seattlerb/block_paren_splat.txt @@ -18,17 +18,19 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,12)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,12)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,11)) - │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) - │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,12)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_args__19.txt b/test/prism/snapshots/seattlerb/bug_args__19.txt index d66e17e8c02..751f990ea00 100644 --- a/test/prism/snapshots/seattlerb/bug_args__19.txt +++ b/test/prism/snapshots/seattlerb/bug_args__19.txt @@ -18,14 +18,16 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,11)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) - │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) │ │ │ │ │ │ └── name: :a │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ └── name: :b - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn.txt b/test/prism/snapshots/seattlerb/bug_args_masgn.txt index b8642292c62..07972ba8596 100644 --- a/test/prism/snapshots/seattlerb/bug_args_masgn.txt +++ b/test/prism/snapshots/seattlerb/bug_args_masgn.txt @@ -18,14 +18,16 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ │ ├── requireds: (length: 2) - │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) - │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ │ └── name: :b - │ │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) │ │ │ │ └── name: :c │ │ │ ├── optionals: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn2.txt b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt index 3010907b419..70a365428f6 100644 --- a/test/prism/snapshots/seattlerb/bug_args_masgn2.txt +++ b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt @@ -18,20 +18,24 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,19)) │ │ │ ├── requireds: (length: 2) - │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,5)-(1,16)) - │ │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,6)-(1,12)) - │ │ │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) │ │ │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) │ │ │ │ │ │ │ │ └── name: :b - │ │ │ │ │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" - │ │ │ │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) │ │ │ │ │ │ └── name: :c - │ │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ │ └── closing_loc: (1,15)-(1,16) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) │ │ │ │ └── name: :d │ │ │ ├── optionals: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt b/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt index b03d5392619..131771924c6 100644 --- a/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt +++ b/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -18,20 +18,24 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,16)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,16)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,6)-(1,12)) - │ │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) │ │ │ │ │ │ │ │ └── name: :k │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) │ │ │ │ │ │ │ └── name: :v - │ │ │ │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" - │ │ │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) │ │ │ │ │ └── name: :i - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,15)-(1,16) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_masgn_right.txt b/test/prism/snapshots/seattlerb/bug_masgn_right.txt index b626f211465..c279e0d81e0 100644 --- a/test/prism/snapshots/seattlerb/bug_masgn_right.txt +++ b/test/prism/snapshots/seattlerb/bug_masgn_right.txt @@ -20,14 +20,16 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) - │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ │ └── name: :b │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3_.txt b/test/prism/snapshots/seattlerb/difficult3_.txt index f86dcd3769b..f4da0a4f760 100644 --- a/test/prism/snapshots/seattlerb/difficult3_.txt +++ b/test/prism/snapshots/seattlerb/difficult3_.txt @@ -20,17 +20,19 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,15)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ └── @ SplatNode (location: (1,12)-(1,14)) - │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) - │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__10.txt b/test/prism/snapshots/seattlerb/difficult3__10.txt index 456b5531fe4..4d6e66c0be7 100644 --- a/test/prism/snapshots/seattlerb/difficult3__10.txt +++ b/test/prism/snapshots/seattlerb/difficult3__10.txt @@ -20,17 +20,19 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,15)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,11)) - │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ │ └── expression: - │ │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) - │ │ │ │ │ │ └── name: :b + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__11.txt b/test/prism/snapshots/seattlerb/difficult3__11.txt index a4a54220940..7ee50022cc7 100644 --- a/test/prism/snapshots/seattlerb/difficult3__11.txt +++ b/test/prism/snapshots/seattlerb/difficult3__11.txt @@ -20,13 +20,15 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,11)) - │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,10)) - │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ └── expression: ∅ - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,11)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__12.txt b/test/prism/snapshots/seattlerb/difficult3__12.txt index 569f28f58ea..6aa538625aa 100644 --- a/test/prism/snapshots/seattlerb/difficult3__12.txt +++ b/test/prism/snapshots/seattlerb/difficult3__12.txt @@ -20,15 +20,17 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,10)) - │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) │ │ │ │ │ └── name: :b - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__6.txt b/test/prism/snapshots/seattlerb/difficult3__6.txt index 37c1ae37003..49eae83c23f 100644 --- a/test/prism/snapshots/seattlerb/difficult3__6.txt +++ b/test/prism/snapshots/seattlerb/difficult3__6.txt @@ -20,19 +20,21 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,18)) - │ │ │ │ ├── parameters: (length: 3) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ ├── @ SplatNode (location: (1,12)-(1,14)) - │ │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" - │ │ │ │ │ │ └── expression: - │ │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) - │ │ │ │ │ │ └── name: :c + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) │ │ │ │ │ └── name: :d - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,17)-(1,18) = ")" + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,17)-(1,18) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__7.txt b/test/prism/snapshots/seattlerb/difficult3__7.txt index da78704f0c0..7c06ac827ed 100644 --- a/test/prism/snapshots/seattlerb/difficult3__7.txt +++ b/test/prism/snapshots/seattlerb/difficult3__7.txt @@ -20,15 +20,17 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) - │ │ │ │ ├── parameters: (length: 2) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ └── @ SplatNode (location: (1,12)-(1,13)) - │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" - │ │ │ │ │ └── expression: ∅ - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__8.txt b/test/prism/snapshots/seattlerb/difficult3__8.txt index ee0baf1471e..5088e00b68f 100644 --- a/test/prism/snapshots/seattlerb/difficult3__8.txt +++ b/test/prism/snapshots/seattlerb/difficult3__8.txt @@ -20,17 +20,19 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,17)) - │ │ │ │ ├── parameters: (length: 3) - │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) - │ │ │ │ │ │ └── name: :b - │ │ │ │ │ ├── @ SplatNode (location: (1,12)-(1,13)) - │ │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" - │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,17)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── rights: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) │ │ │ │ │ └── name: :c - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,16)-(1,17) = ")" + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,16)-(1,17) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__9.txt b/test/prism/snapshots/seattlerb/difficult3__9.txt index 391bb7b3d12..8918bf49cf9 100644 --- a/test/prism/snapshots/seattlerb/difficult3__9.txt +++ b/test/prism/snapshots/seattlerb/difficult3__9.txt @@ -20,15 +20,17 @@ │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,12)) - │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,11)) - │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) - │ │ │ │ │ └── name: :b - │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,12)) + │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/iter_args_2__19.txt b/test/prism/snapshots/seattlerb/iter_args_2__19.txt index 285002476a6..f9b9e2cf251 100644 --- a/test/prism/snapshots/seattlerb/iter_args_2__19.txt +++ b/test/prism/snapshots/seattlerb/iter_args_2__19.txt @@ -18,14 +18,16 @@ │ │ ├── parameters: │ │ │ @ ParametersNode (location: (1,5)-(1,11)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) - │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) │ │ │ │ │ │ └── name: :a │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ └── name: :b - │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/iter_args_3.txt b/test/prism/snapshots/seattlerb/iter_args_3.txt index 2835f1f4327..85da0b88ff5 100644 --- a/test/prism/snapshots/seattlerb/iter_args_3.txt +++ b/test/prism/snapshots/seattlerb/iter_args_3.txt @@ -20,14 +20,16 @@ │ │ │ ├── requireds: (length: 3) │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) │ │ │ │ │ └── name: :a - │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) - │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) │ │ │ │ │ │ │ └── name: :b │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) │ │ │ │ │ │ └── name: :c - │ │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" - │ │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) │ │ │ │ └── name: :d │ │ │ ├── optionals: (length: 0) diff --git a/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt index 5ccc262305e..9b6f9169f4f 100644 --- a/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt @@ -4,14 +4,12 @@ @ StatementsNode (location: (1,0)-(1,8)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,8)) - ├── targets: (length: 2) - │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: ∅ - │ │ ├── lparen_loc: ∅ - │ │ └── rparen_loc: ∅ + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (length: 1) │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ ├── name: :a │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt index 87b7f012d8a..332ffbfa22d 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 @@ -28,6 +28,8 @@ │ ├── block: ∅ │ ├── flags: ∅ │ └── name: :c= + ├── rest: ∅ + ├── rights: (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 11819f9ac1f..67fe4011535 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 @@ -28,6 +28,8 @@ │ ├── block: ∅ │ ├── flags: ∅ │ └── name: :C= + ├── rest: ∅ + ├── rights: (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 a350febe3c0..0915b21e5d6 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 + ├── lefts: (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 + ├── rights: (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 2c9ecd75bb0..0953bc3cf7a 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) + ├── lefts: (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: ∅ + ├── rights: (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 1c97b15d23f..e70d2268b7e 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) + ├── lefts: (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: ∅ + ├── rights: (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 5f20de9ec16..2e0105c455a 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: ∅ + ├── lefts: (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: ∅ + ├── rights: (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 d9bc98dbe80..2a8702053ef 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) + ├── lefts: (length: 1) │ └── @ MultiTargetNode (location: (1,1)-(1,6)) - │ ├── targets: (length: 2) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: (1,1)-(1,2) = "(" │ └── rparen_loc: (1,5)-(1,6) = ")" + ├── rest: ∅ + ├── rights: (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 49b717143b3..656f71ebbe9 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 + ├── lefts: (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 + ├── rights: (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 9e8ce7a49df..a212a456352 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,2)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── rights: (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 49a30e983ac..1be6d5906c5 100644 --- a/test/prism/snapshots/seattlerb/masgn_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt @@ -4,17 +4,15 @@ @ StatementsNode (location: (1,0)-(1,9)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,9)) - ├── targets: (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 - │ │ ├── lparen_loc: ∅ - │ │ └── rparen_loc: ∅ + ├── lefts: (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 + ├── rights: (length: 1) │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ ├── name: :b │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt index c22d376e066..d0ecbadfa9d 100644 --- a/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt @@ -4,17 +4,15 @@ @ StatementsNode (location: (1,0)-(1,12)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,12)) - ├── targets: (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 - │ │ ├── lparen_loc: ∅ - │ │ └── rparen_loc: ∅ + ├── lefts: (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 + ├── rights: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ ├── name: :b │ │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/masgn_star.txt b/test/prism/snapshots/seattlerb/masgn_star.txt index f86b63fbd0c..22783c909d2 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: ∅ + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (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 7b9e9354547..fe129e7b480 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: ∅ + ├── lefts: (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: ∅ + ├── rights: (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 e1c1b23e9f2..b6c722c108a 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) + ├── lefts: (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: ∅ + ├── rights: (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 0f1d46ae80a..644e54bc6e3 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) + ├── lefts: (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 + ├── rights: (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 af2c8c9c850..d8a1fcb6f56 100644 --- a/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt @@ -4,14 +4,12 @@ @ StatementsNode (location: (1,0)-(1,14)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,14)) - ├── targets: (length: 4) - │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) - │ │ ├── targets: (length: 1) - │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) - │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" - │ │ │ └── expression: ∅ - │ │ ├── lparen_loc: ∅ - │ │ └── rparen_loc: ∅ + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ │ ├── name: :x │ │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/mlhs_front_splat.txt b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt index 08996bba60b..48fc7f5e3b4 100644 --- a/test/prism/snapshots/seattlerb/mlhs_front_splat.txt +++ b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt @@ -4,17 +4,15 @@ @ StatementsNode (location: (1,0)-(1,15)) └── body: (length: 1) └── @ MultiWriteNode (location: (1,0)-(1,15)) - ├── targets: (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 - │ │ ├── lparen_loc: ∅ - │ │ └── rparen_loc: ∅ + ├── lefts: (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 + ├── rights: (length: 3) │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ ├── name: :x │ │ └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt index 6f98c0efeb3..8781fd3229e 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) + ├── lefts: (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: ∅ + ├── rights: (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 01e181f3477..ceb3fd0018f 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) + ├── lefts: (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 + ├── rights: (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 9f833537abb..79152dc74fa 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── rights: (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 7aa6dcd035b..551cae4ba9f 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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (2,0)-(2,1)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (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 fd22b8a60f3..1400bb60616 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) + │ ├── lefts: (length: 2) │ │ ├── @ GlobalVariableTargetNode (location: (2,1)-(2,3)) │ │ │ └── name: :$a │ │ └── @ GlobalVariableTargetNode (location: (2,5)-(2,7)) │ │ └── name: :$b + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (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: ∅ + │ │ │ ├── lefts: (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: ∅ + │ │ │ ├── rights: (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: ∅ + │ ├── rights: (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 + │ ├── lefts: (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 + │ ├── rights: (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 + │ ├── lefts: (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 + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ ClassVariableTargetNode (location: (6,1)-(6,4)) │ │ │ └── name: :@@a │ │ └── @ ClassVariableTargetNode (location: (6,6)-(6,9)) │ │ └── name: :@@b + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (7,1)-(7,3)) │ │ │ └── name: :@a │ │ └── @ InstanceVariableTargetNode (location: (7,5)-(7,7)) │ │ └── name: :@b + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (8,1)-(8,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ MultiTargetNode (location: (8,4)-(8,10)) - │ │ ├── targets: (length: 2) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (8,5)-(8,6)) │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (8,8)-(8,9)) │ │ │ ├── name: :c │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: (8,4)-(8,5) = "(" │ │ └── rparen_loc: (8,9)-(8,10) = ")" + │ ├── rest: ∅ + │ ├── rights: (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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (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 + │ ├── lefts: (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 + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (11,1)-(11,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (11,4)-(11,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (12,1)-(12,2)) │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (12,4)-(12,5)) │ │ ├── name: :b │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (14,1)-(14,6)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (14,1)-(14,2)) @@ -275,6 +303,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :bar= + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (15,1)-(15,8)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (15,1)-(15,2)) @@ -329,6 +359,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (16,1)-(16,5)) │ │ │ ├── receiver: │ │ │ │ @ LocalVariableReadNode (location: (16,1)-(16,2)) @@ -379,6 +411,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── rights: (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= + │ ├── lefts: (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= + │ ├── rights: (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) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ LocalVariableTargetNode (location: (23,6)-(23,7)) │ │ │ │ │ ├── name: :b │ │ │ │ │ └── depth: 0 │ │ │ │ └── @ LocalVariableTargetNode (location: (23,9)-(23,10)) │ │ │ │ ├── name: :c │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (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/block.txt b/test/prism/snapshots/unparser/corpus/literal/block.txt index e36e8116ace..54ad868a859 100644 --- a/test/prism/snapshots/unparser/corpus/literal/block.txt +++ b/test/prism/snapshots/unparser/corpus/literal/block.txt @@ -308,14 +308,16 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (23,11)-(23,20)) │ │ │ │ ├── requireds: (length: 2) - │ │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (23,11)-(23,17)) - │ │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ MultiTargetNode (location: (23,11)-(23,17)) + │ │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (23,12)-(23,13)) │ │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (23,15)-(23,16)) │ │ │ │ │ │ │ └── name: :b - │ │ │ │ │ │ ├── opening_loc: (23,11)-(23,12) = "(" - │ │ │ │ │ │ └── closing_loc: (23,16)-(23,17) = ")" + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (23,11)-(23,12) = "(" + │ │ │ │ │ │ └── rparen_loc: (23,16)-(23,17) = ")" │ │ │ │ │ └── @ RequiredParameterNode (location: (23,19)-(23,20)) │ │ │ │ │ └── name: :c │ │ │ │ ├── optionals: (length: 0) @@ -547,13 +549,15 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (35,11)-(35,14)) │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (35,11)-(35,14)) - │ │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ │ └── @ SplatNode (location: (35,12)-(35,13)) - │ │ │ │ │ │ ├── operator_loc: (35,12)-(35,13) = "*" - │ │ │ │ │ │ └── expression: ∅ - │ │ │ │ │ ├── opening_loc: (35,11)-(35,12) = "(" - │ │ │ │ │ └── closing_loc: (35,13)-(35,14) = ")" + │ │ │ │ │ └── @ MultiTargetNode (location: (35,11)-(35,14)) + │ │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ │ ├── rest: + │ │ │ │ │ │ @ SplatNode (location: (35,12)-(35,13)) + │ │ │ │ │ │ ├── operator_loc: (35,12)-(35,13) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (35,11)-(35,12) = "(" + │ │ │ │ │ └── rparen_loc: (35,13)-(35,14) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) @@ -605,17 +609,21 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (38,11)-(38,16)) │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (38,11)-(38,16)) - │ │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (38,12)-(38,15)) - │ │ │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ │ │ └── @ SplatNode (location: (38,13)-(38,14)) - │ │ │ │ │ │ │ ├── operator_loc: (38,13)-(38,14) = "*" - │ │ │ │ │ │ │ └── expression: ∅ - │ │ │ │ │ │ ├── opening_loc: (38,12)-(38,13) = "(" - │ │ │ │ │ │ └── closing_loc: (38,14)-(38,15) = ")" - │ │ │ │ │ ├── opening_loc: (38,11)-(38,12) = "(" - │ │ │ │ │ └── closing_loc: (38,15)-(38,16) = ")" + │ │ │ │ │ └── @ MultiTargetNode (location: (38,11)-(38,16)) + │ │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ │ └── @ MultiTargetNode (location: (38,12)-(38,15)) + │ │ │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ │ │ ├── rest: + │ │ │ │ │ │ │ @ SplatNode (location: (38,13)-(38,14)) + │ │ │ │ │ │ │ ├── operator_loc: (38,13)-(38,14) = "*" + │ │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (38,12)-(38,13) = "(" + │ │ │ │ │ │ └── rparen_loc: (38,14)-(38,15) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (38,11)-(38,12) = "(" + │ │ │ │ │ └── rparen_loc: (38,15)-(38,16) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) @@ -667,19 +675,23 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (41,11)-(41,19)) │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (41,11)-(41,19)) - │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ └── @ MultiTargetNode (location: (41,11)-(41,19)) + │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (41,12)-(41,13)) │ │ │ │ │ │ │ └── name: :a - │ │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (41,15)-(41,18)) - │ │ │ │ │ │ ├── parameters: (length: 1) - │ │ │ │ │ │ │ └── @ SplatNode (location: (41,16)-(41,17)) - │ │ │ │ │ │ │ ├── operator_loc: (41,16)-(41,17) = "*" - │ │ │ │ │ │ │ └── expression: ∅ - │ │ │ │ │ │ ├── opening_loc: (41,15)-(41,16) = "(" - │ │ │ │ │ │ └── closing_loc: (41,17)-(41,18) = ")" - │ │ │ │ │ ├── opening_loc: (41,11)-(41,12) = "(" - │ │ │ │ │ └── closing_loc: (41,18)-(41,19) = ")" + │ │ │ │ │ │ └── @ MultiTargetNode (location: (41,15)-(41,18)) + │ │ │ │ │ │ ├── lefts: (length: 0) + │ │ │ │ │ │ ├── rest: + │ │ │ │ │ │ │ @ SplatNode (location: (41,16)-(41,17)) + │ │ │ │ │ │ │ ├── operator_loc: (41,16)-(41,17) = "*" + │ │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (41,15)-(41,16) = "(" + │ │ │ │ │ │ └── rparen_loc: (41,17)-(41,18) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (41,11)-(41,12) = "(" + │ │ │ │ │ └── rparen_loc: (41,18)-(41,19) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) @@ -731,14 +743,16 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (44,11)-(44,17)) │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (44,11)-(44,17)) - │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ └── @ MultiTargetNode (location: (44,11)-(44,17)) + │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (44,12)-(44,13)) │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ └── @ RequiredParameterNode (location: (44,15)-(44,16)) │ │ │ │ │ │ └── name: :b - │ │ │ │ │ ├── opening_loc: (44,11)-(44,12) = "(" - │ │ │ │ │ └── closing_loc: (44,16)-(44,17) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (44,11)-(44,12) = "(" + │ │ │ │ │ └── rparen_loc: (44,16)-(44,17) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/unparser/corpus/literal/def.txt b/test/prism/snapshots/unparser/corpus/literal/def.txt index 9c839f07849..d59d0e21a55 100644 --- a/test/prism/snapshots/unparser/corpus/literal/def.txt +++ b/test/prism/snapshots/unparser/corpus/literal/def.txt @@ -1053,16 +1053,20 @@ │ ├── parameters: │ │ @ ParametersNode (location: (120,6)-(120,11)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (120,6)-(120,11)) - │ │ │ ├── parameters: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (120,7)-(120,10)) - │ │ │ │ ├── parameters: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (120,6)-(120,11)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (120,7)-(120,10)) + │ │ │ │ ├── lefts: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (120,8)-(120,9)) │ │ │ │ │ └── name: :a - │ │ │ │ ├── opening_loc: (120,7)-(120,8) = "(" - │ │ │ │ └── closing_loc: (120,9)-(120,10) = ")" - │ │ │ ├── opening_loc: (120,6)-(120,7) = "(" - │ │ │ └── closing_loc: (120,10)-(120,11) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (120,7)-(120,8) = "(" + │ │ │ │ └── rparen_loc: (120,9)-(120,10) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (120,6)-(120,7) = "(" + │ │ │ └── rparen_loc: (120,10)-(120,11) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/unparser/corpus/literal/defined.txt b/test/prism/snapshots/unparser/corpus/literal/defined.txt index ffa9bfbba8c..7e375eaa3fe 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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (3,11)-(3,12)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (3,14)-(3,15)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (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 dac6b67e3c9..d9a8cc048b4 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 + │ │ ├── lefts: (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 + │ │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (10,5)-(10,6)) │ │ │ ├── name: :a │ │ │ └── depth: 1 │ │ └── @ LocalVariableTargetNode (location: (10,8)-(10,9)) │ │ ├── name: :b │ │ └── depth: 1 + │ ├── rest: ∅ + │ ├── rights: (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 be363a4cf75..9e286813bf6 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) + │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ LocalVariableTargetNode (location: (2,12)-(2,13)) │ │ │ │ │ │ ├── name: :a │ │ │ │ │ │ └── depth: 0 │ │ │ │ │ └── @ LocalVariableTargetNode (location: (2,15)-(2,16)) │ │ │ │ │ ├── name: :_ │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (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 8a0942b7788..632348b67a7 100644 --- a/test/prism/snapshots/variables.txt +++ b/test/prism/snapshots/variables.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(45,9)) -├── locals: [:abc, :foo, :bar, :baz] +@ ProgramNode (location: (1,0)-(47,17)) +├── locals: [:abc, :foo, :bar, :baz, :a, :b, :c, :d] └── statements: - @ StatementsNode (location: (1,0)-(45,9)) - └── body: (length: 24) + @ StatementsNode (location: (1,0)-(47,17)) + └── body: (length: 25) ├── @ ClassVariableReadNode (location: (1,0)-(1,5)) │ └── name: :@@abc ├── @ ClassVariableWriteNode (location: (3,0)-(3,9)) @@ -13,11 +13,13 @@ │ │ └── flags: decimal │ └── operator_loc: (3,6)-(3,7) = "=" ├── @ MultiWriteNode (location: (5,0)-(5,16)) - │ ├── targets: (length: 2) + │ ├── lefts: (length: 2) │ │ ├── @ ClassVariableTargetNode (location: (5,0)-(5,5)) │ │ │ └── name: :@@foo │ │ └── @ ClassVariableTargetNode (location: (5,7)-(5,12)) │ │ └── name: :@@bar + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ GlobalVariableTargetNode (location: (21,0)-(21,4)) │ │ │ └── name: :$foo │ │ └── @ GlobalVariableTargetNode (location: (21,6)-(21,10)) │ │ └── name: :$bar + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (25,0)-(25,4)) │ │ │ └── name: :@foo │ │ └── @ InstanceVariableTargetNode (location: (25,6)-(25,10)) │ │ └── name: :@bar + │ ├── rest: ∅ + │ ├── rights: (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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (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 + │ ├── lefts: (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 + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (39,0)-(39,3)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ MultiTargetNode (location: (39,5)-(39,15)) - │ │ ├── targets: (length: 2) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (39,6)-(39,9)) │ │ │ │ ├── name: :bar │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (39,11)-(39,14)) │ │ │ ├── name: :baz │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: (39,5)-(39,6) = "(" │ │ └── rparen_loc: (39,14)-(39,15) = ")" + │ ├── rest: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (39,16)-(39,17) = "=" @@ -284,39 +300,69 @@ │ │ ├── opening_loc: ∅ │ │ └── closing_loc: ∅ │ └── operator_loc: (43,4)-(43,5) = "=" - └── @ ParenthesesNode (location: (45,0)-(45,9)) - ├── body: - │ @ StatementsNode (location: (45,1)-(45,8)) - │ └── body: (length: 3) - │ ├── @ CallNode (location: (45,1)-(45,2)) - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── message_loc: (45,1)-(45,2) = "a" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ ├── block: ∅ - │ │ ├── flags: variable_call - │ │ └── name: :a - │ ├── @ CallNode (location: (45,4)-(45,5)) - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── message_loc: (45,4)-(45,5) = "b" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ ├── block: ∅ - │ │ ├── flags: variable_call - │ │ └── name: :b - │ └── @ CallNode (location: (45,7)-(45,8)) - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── message_loc: (45,7)-(45,8) = "c" - │ ├── opening_loc: ∅ - │ ├── arguments: ∅ - │ ├── closing_loc: ∅ - │ ├── block: ∅ - │ ├── flags: variable_call - │ └── name: :c - ├── opening_loc: (45,0)-(45,1) = "(" - └── closing_loc: (45,8)-(45,9) = ")" + ├── @ ParenthesesNode (location: (45,0)-(45,9)) + │ ├── body: + │ │ @ StatementsNode (location: (45,1)-(45,8)) + │ │ └── body: (length: 3) + │ │ ├── @ CallNode (location: (45,1)-(45,2)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (45,1)-(45,2) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: :a + │ │ ├── @ CallNode (location: (45,4)-(45,5)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (45,4)-(45,5) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: :b + │ │ └── @ CallNode (location: (45,7)-(45,8)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (45,7)-(45,8) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: :c + │ ├── opening_loc: (45,0)-(45,1) = "(" + │ └── closing_loc: (45,8)-(45,9) = ")" + └── @ MultiWriteNode (location: (47,0)-(47,17)) + ├── lefts: (length: 3) + │ ├── @ LocalVariableTargetNode (location: (47,0)-(47,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ MultiTargetNode (location: (47,3)-(47,9)) + │ │ ├── lefts: (length: 2) + │ │ │ ├── @ LocalVariableTargetNode (location: (47,4)-(47,5)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableTargetNode (location: (47,7)-(47,8)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) + │ │ ├── lparen_loc: (47,3)-(47,4) = "(" + │ │ └── rparen_loc: (47,8)-(47,9) = ")" + │ └── @ LocalVariableTargetNode (location: (47,11)-(47,12)) + │ ├── name: :d + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (47,13)-(47,14) = "=" + └── value: + @ ArrayNode (location: (47,15)-(47,17)) + ├── elements: (length: 0) + ├── opening_loc: (47,15)-(47,16) = "[" + └── closing_loc: (47,16)-(47,17) = "]" diff --git a/test/prism/snapshots/whitequark/and_or_masgn.txt b/test/prism/snapshots/whitequark/and_or_masgn.txt index 370fa32afa0..ac148ceadff 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) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ LocalVariableTargetNode (location: (1,8)-(1,9)) │ │ │ │ │ ├── name: :a │ │ │ │ │ └── depth: 0 │ │ │ │ └── @ LocalVariableTargetNode (location: (1,11)-(1,12)) │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (3,8)-(3,9)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (3,11)-(3,12)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (3,13)-(3,14) = "=" diff --git a/test/prism/snapshots/whitequark/args.txt b/test/prism/snapshots/whitequark/args.txt index 1f3a3b5c74a..3e20260009d 100644 --- a/test/prism/snapshots/whitequark/args.txt +++ b/test/prism/snapshots/whitequark/args.txt @@ -35,16 +35,20 @@ │ ├── parameters: │ │ @ ParametersNode (location: (3,7)-(3,12)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (3,7)-(3,12)) - │ │ │ ├── parameters: (length: 1) - │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (3,8)-(3,11)) - │ │ │ │ ├── parameters: (length: 1) + │ │ │ └── @ MultiTargetNode (location: (3,7)-(3,12)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (3,8)-(3,11)) + │ │ │ │ ├── lefts: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (3,9)-(3,10)) │ │ │ │ │ └── name: :a - │ │ │ │ ├── opening_loc: (3,8)-(3,9) = "(" - │ │ │ │ └── closing_loc: (3,10)-(3,11) = ")" - │ │ │ ├── opening_loc: (3,7)-(3,8) = "(" - │ │ │ └── closing_loc: (3,11)-(3,12) = ")" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (3,8)-(3,9) = "(" + │ │ │ │ └── rparen_loc: (3,10)-(3,11) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (3,7)-(3,8) = "(" + │ │ │ └── rparen_loc: (3,11)-(3,12) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -66,13 +70,15 @@ │ ├── parameters: │ │ @ ParametersNode (location: (5,7)-(5,10)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (5,7)-(5,10)) - │ │ │ ├── parameters: (length: 1) - │ │ │ │ └── @ SplatNode (location: (5,8)-(5,9)) - │ │ │ │ ├── operator_loc: (5,8)-(5,9) = "*" - │ │ │ │ └── expression: ∅ - │ │ │ ├── opening_loc: (5,7)-(5,8) = "(" - │ │ │ └── closing_loc: (5,9)-(5,10) = ")" + │ │ │ └── @ MultiTargetNode (location: (5,7)-(5,10)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (5,8)-(5,9)) + │ │ │ │ ├── operator_loc: (5,8)-(5,9) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (5,7)-(5,8) = "(" + │ │ │ └── rparen_loc: (5,9)-(5,10) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -94,15 +100,17 @@ │ ├── parameters: │ │ @ ParametersNode (location: (7,7)-(7,13)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (7,7)-(7,13)) - │ │ │ ├── parameters: (length: 2) - │ │ │ │ ├── @ SplatNode (location: (7,8)-(7,9)) - │ │ │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" - │ │ │ │ │ └── expression: ∅ + │ │ │ └── @ MultiTargetNode (location: (7,7)-(7,13)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (7,8)-(7,9)) + │ │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (7,11)-(7,12)) │ │ │ │ └── name: :p - │ │ │ ├── opening_loc: (7,7)-(7,8) = "(" - │ │ │ └── closing_loc: (7,12)-(7,13) = ")" + │ │ │ ├── lparen_loc: (7,7)-(7,8) = "(" + │ │ │ └── rparen_loc: (7,12)-(7,13) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -124,15 +132,17 @@ │ ├── parameters: │ │ @ ParametersNode (location: (9,7)-(9,11)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (9,7)-(9,11)) - │ │ │ ├── parameters: (length: 1) - │ │ │ │ └── @ SplatNode (location: (9,8)-(9,10)) - │ │ │ │ ├── operator_loc: (9,8)-(9,9) = "*" - │ │ │ │ └── expression: - │ │ │ │ @ RequiredParameterNode (location: (9,9)-(9,10)) - │ │ │ │ └── name: :r - │ │ │ ├── opening_loc: (9,7)-(9,8) = "(" - │ │ │ └── closing_loc: (9,10)-(9,11) = ")" + │ │ │ └── @ MultiTargetNode (location: (9,7)-(9,11)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (9,8)-(9,10)) + │ │ │ │ ├── operator_loc: (9,8)-(9,9) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (9,9)-(9,10)) + │ │ │ │ └── name: :r + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (9,7)-(9,8) = "(" + │ │ │ └── rparen_loc: (9,10)-(9,11) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -154,17 +164,19 @@ │ ├── parameters: │ │ @ ParametersNode (location: (11,7)-(11,14)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (11,7)-(11,14)) - │ │ │ ├── parameters: (length: 2) - │ │ │ │ ├── @ SplatNode (location: (11,8)-(11,10)) - │ │ │ │ │ ├── operator_loc: (11,8)-(11,9) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (11,9)-(11,10)) - │ │ │ │ │ └── name: :r + │ │ │ └── @ MultiTargetNode (location: (11,7)-(11,14)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (11,8)-(11,10)) + │ │ │ │ ├── operator_loc: (11,8)-(11,9) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (11,9)-(11,10)) + │ │ │ │ └── name: :r + │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (11,12)-(11,13)) │ │ │ │ └── name: :p - │ │ │ ├── opening_loc: (11,7)-(11,8) = "(" - │ │ │ └── closing_loc: (11,13)-(11,14) = ")" + │ │ │ ├── lparen_loc: (11,7)-(11,8) = "(" + │ │ │ └── rparen_loc: (11,13)-(11,14) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -186,15 +198,17 @@ │ ├── parameters: │ │ @ ParametersNode (location: (13,7)-(13,13)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (13,7)-(13,13)) - │ │ │ ├── parameters: (length: 2) - │ │ │ │ ├── @ RequiredParameterNode (location: (13,8)-(13,9)) - │ │ │ │ │ └── name: :a - │ │ │ │ └── @ SplatNode (location: (13,11)-(13,12)) - │ │ │ │ ├── operator_loc: (13,11)-(13,12) = "*" - │ │ │ │ └── expression: ∅ - │ │ │ ├── opening_loc: (13,7)-(13,8) = "(" - │ │ │ └── closing_loc: (13,12)-(13,13) = ")" + │ │ │ └── @ MultiTargetNode (location: (13,7)-(13,13)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (13,11)-(13,12)) + │ │ │ │ ├── operator_loc: (13,11)-(13,12) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (13,7)-(13,8) = "(" + │ │ │ └── rparen_loc: (13,12)-(13,13) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -216,17 +230,19 @@ │ ├── parameters: │ │ @ ParametersNode (location: (15,7)-(15,16)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (15,7)-(15,16)) - │ │ │ ├── parameters: (length: 3) - │ │ │ │ ├── @ RequiredParameterNode (location: (15,8)-(15,9)) - │ │ │ │ │ └── name: :a - │ │ │ │ ├── @ SplatNode (location: (15,11)-(15,12)) - │ │ │ │ │ ├── operator_loc: (15,11)-(15,12) = "*" - │ │ │ │ │ └── expression: ∅ + │ │ │ └── @ MultiTargetNode (location: (15,7)-(15,16)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (15,8)-(15,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (15,11)-(15,12)) + │ │ │ │ ├── operator_loc: (15,11)-(15,12) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (15,14)-(15,15)) │ │ │ │ └── name: :p - │ │ │ ├── opening_loc: (15,7)-(15,8) = "(" - │ │ │ └── closing_loc: (15,15)-(15,16) = ")" + │ │ │ ├── lparen_loc: (15,7)-(15,8) = "(" + │ │ │ └── rparen_loc: (15,15)-(15,16) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -248,17 +264,19 @@ │ ├── parameters: │ │ @ ParametersNode (location: (17,7)-(17,14)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (17,7)-(17,14)) - │ │ │ ├── parameters: (length: 2) - │ │ │ │ ├── @ RequiredParameterNode (location: (17,8)-(17,9)) - │ │ │ │ │ └── name: :a - │ │ │ │ └── @ SplatNode (location: (17,11)-(17,13)) - │ │ │ │ ├── operator_loc: (17,11)-(17,12) = "*" - │ │ │ │ └── expression: - │ │ │ │ @ RequiredParameterNode (location: (17,12)-(17,13)) - │ │ │ │ └── name: :r - │ │ │ ├── opening_loc: (17,7)-(17,8) = "(" - │ │ │ └── closing_loc: (17,13)-(17,14) = ")" + │ │ │ └── @ MultiTargetNode (location: (17,7)-(17,14)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (17,8)-(17,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (17,11)-(17,13)) + │ │ │ │ ├── operator_loc: (17,11)-(17,12) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (17,12)-(17,13)) + │ │ │ │ └── name: :r + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (17,7)-(17,8) = "(" + │ │ │ └── rparen_loc: (17,13)-(17,14) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -280,19 +298,21 @@ │ ├── parameters: │ │ @ ParametersNode (location: (19,7)-(19,17)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (19,7)-(19,17)) - │ │ │ ├── parameters: (length: 3) - │ │ │ │ ├── @ RequiredParameterNode (location: (19,8)-(19,9)) - │ │ │ │ │ └── name: :a - │ │ │ │ ├── @ SplatNode (location: (19,11)-(19,13)) - │ │ │ │ │ ├── operator_loc: (19,11)-(19,12) = "*" - │ │ │ │ │ └── expression: - │ │ │ │ │ @ RequiredParameterNode (location: (19,12)-(19,13)) - │ │ │ │ │ └── name: :r + │ │ │ └── @ MultiTargetNode (location: (19,7)-(19,17)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,8)-(19,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (19,11)-(19,13)) + │ │ │ │ ├── operator_loc: (19,11)-(19,12) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (19,12)-(19,13)) + │ │ │ │ └── name: :r + │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (19,15)-(19,16)) │ │ │ │ └── name: :p - │ │ │ ├── opening_loc: (19,7)-(19,8) = "(" - │ │ │ └── closing_loc: (19,16)-(19,17) = ")" + │ │ │ ├── lparen_loc: (19,7)-(19,8) = "(" + │ │ │ └── rparen_loc: (19,16)-(19,17) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) @@ -314,14 +334,16 @@ │ ├── parameters: │ │ @ ParametersNode (location: (21,7)-(21,14)) │ │ ├── requireds: (length: 1) - │ │ │ └── @ RequiredDestructuredParameterNode (location: (21,7)-(21,14)) - │ │ │ ├── parameters: (length: 2) + │ │ │ └── @ MultiTargetNode (location: (21,7)-(21,14)) + │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (21,8)-(21,9)) │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (21,11)-(21,13)) │ │ │ │ └── name: :a1 - │ │ │ ├── opening_loc: (21,7)-(21,8) = "(" - │ │ │ └── closing_loc: (21,13)-(21,14) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (21,7)-(21,8) = "(" + │ │ │ └── rparen_loc: (21,13)-(21,14) = ")" │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/whitequark/cond_begin_masgn.txt b/test/prism/snapshots/whitequark/cond_begin_masgn.txt index e30a3989f48..4037a2a0c2c 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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,9)-(1,10)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,12)-(1,13)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (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 27d201a6890..21960c4b332 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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ │ ├── name: :a │ │ │ └── depth: 1 │ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ │ ├── name: :b │ │ └── depth: 1 + │ ├── rest: ∅ + │ ├── rights: (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 bcd74cc0678..75168eb066a 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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (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 e62f8e4ca73..621204b1867 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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,4)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (1,6)-(1,9)) │ │ ├── name: :bar │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,3)) │ │ │ ├── name: :foo │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (3,5)-(3,8)) │ │ ├── name: :bar │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (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) + ├── lefts: (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: ∅ + ├── rights: (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 0280897b7b2..b74843a60c0 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) + │ ├── lefts: (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: ∅ + │ ├── rights: (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) + │ ├── lefts: (length: 2) │ │ ├── @ CallNode (location: (3,0)-(3,6)) │ │ │ ├── receiver: │ │ │ │ @ SelfNode (location: (3,0)-(3,4)) @@ -57,6 +59,8 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :[]= + │ ├── rest: ∅ + │ ├── rights: (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) + ├── lefts: (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: ∅ + ├── rights: (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 a671ec8d381..003dd47c136 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) │ │ ├── name: :foo │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) │ ├── name: :bar │ └── depth: 0 + ├── rest: ∅ + ├── rights: (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 3cd8f13a78d..56169deb17b 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) + │ ├── lefts: (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: ∅ + │ ├── rights: (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) + ├── lefts: (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: ∅ + ├── rights: (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 45e05e574db..4ee7ea3e00c 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) + │ ├── lefts: (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: ∅ + │ │ ├── lefts: (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: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: (1,1)-(1,2) = "(" │ │ └── rparen_loc: (1,5)-(1,6) = ")" + │ ├── rest: ∅ + │ ├── rights: (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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (3,0)-(3,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ MultiTargetNode (location: (3,3)-(3,9)) - │ ├── targets: (length: 2) + │ ├── lefts: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (3,4)-(3,5)) │ │ │ ├── name: :b │ │ │ └── depth: 0 │ │ └── @ LocalVariableTargetNode (location: (3,7)-(3,8)) │ │ ├── name: :c │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: (3,3)-(3,4) = "(" │ └── rparen_loc: (3,8)-(3,9) = ")" + ├── rest: ∅ + ├── rights: (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 a818fc141d7..79518960212 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: ∅ + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (1,0)-(1,1)) + │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (1,2)-(1,3) = "=" @@ -23,14 +25,12 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (3,0)-(3,13)) - │ ├── targets: (length: 3) - │ │ ├── @ MultiTargetNode (location: (3,0)-(3,1)) - │ │ │ ├── targets: (length: 1) - │ │ │ │ └── @ SplatNode (location: (3,0)-(3,1)) - │ │ │ │ ├── operator_loc: (3,0)-(3,1) = "*" - │ │ │ │ └── expression: ∅ - │ │ │ ├── lparen_loc: ∅ - │ │ │ └── rparen_loc: ∅ + │ ├── lefts: (length: 0) + │ ├── rest: + │ │ @ SplatNode (location: (3,0)-(3,1)) + │ │ ├── operator_loc: (3,0)-(3,1) = "*" + │ │ └── expression: ∅ + │ ├── rights: (length: 2) │ │ ├── @ LocalVariableTargetNode (location: (3,3)-(3,4)) │ │ │ ├── name: :c │ │ │ └── depth: 0 @@ -52,13 +52,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 + │ ├── lefts: (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 + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (5,3)-(5,4) = "=" @@ -74,17 +76,15 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (7,0)-(7,11)) - │ ├── targets: (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 - │ │ │ ├── lparen_loc: ∅ - │ │ │ └── rparen_loc: ∅ + │ ├── lefts: (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 + │ ├── rights: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (7,4)-(7,5)) │ │ ├── name: :c │ │ └── depth: 0 @@ -103,11 +103,13 @@ │ ├── flags: variable_call │ └── name: :bar ├── @ MultiWriteNode (location: (9,0)-(9,18)) - │ ├── targets: (length: 2) + │ ├── lefts: (length: 2) │ │ ├── @ InstanceVariableTargetNode (location: (9,0)-(9,4)) │ │ │ └── name: :@foo │ │ └── @ ClassVariableTargetNode (location: (9,6)-(9,11)) │ │ └── name: :@@bar + │ ├── rest: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (9,12)-(9,13) = "=" @@ -130,13 +132,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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (11,5)-(11,6) = "=" @@ -152,13 +156,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: ∅ + │ ├── lefts: (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: ∅ + │ ├── rights: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (13,6)-(13,7)) │ │ ├── name: :c │ │ └── depth: 0 @@ -177,16 +183,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 + │ ├── lefts: (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 + │ ├── rights: (length: 0) │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── operator_loc: (15,6)-(15,7) = "=" @@ -202,16 +210,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 + │ ├── lefts: (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 + │ ├── rights: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (17,7)-(17,8)) │ │ ├── name: :c │ │ └── depth: 0 @@ -230,13 +240,15 @@ │ ├── flags: variable_call │ └── name: :bar └── @ MultiWriteNode (location: (19,0)-(19,16)) - ├── targets: (length: 2) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (19,0)-(19,1)) │ │ ├── name: :a │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (19,3)-(19,4)) │ ├── name: :b │ └── depth: 0 + ├── rest: ∅ + ├── rights: (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 3ca00981a38..59fea27a14c 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) + │ │ ├── lefts: (length: 2) │ │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) │ │ │ │ ├── name: :a │ │ │ │ └── depth: 0 │ │ │ └── @ LocalVariableTargetNode (location: (1,5)-(1,6)) │ │ │ ├── name: :b │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── rights: (length: 0) │ │ ├── lparen_loc: ∅ │ │ ├── rparen_loc: ∅ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/whitequark/procarg0.txt b/test/prism/snapshots/whitequark/procarg0.txt index 72652f9ef93..9f552d7ba45 100644 --- a/test/prism/snapshots/whitequark/procarg0.txt +++ b/test/prism/snapshots/whitequark/procarg0.txt @@ -18,14 +18,16 @@ │ │ │ ├── parameters: │ │ │ │ @ ParametersNode (location: (1,5)-(1,15)) │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,15)) - │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) + │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,9)) │ │ │ │ │ │ │ └── name: :foo │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,14)) │ │ │ │ │ │ └── name: :bar - │ │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" - │ │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) diff --git a/test/prism/snapshots/whitequark/rescue_mod_masgn.txt b/test/prism/snapshots/whitequark/rescue_mod_masgn.txt index c7d96c45c24..580734a1e36 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) + ├── lefts: (length: 2) │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,3)) │ │ ├── name: :foo │ │ └── depth: 0 │ └── @ LocalVariableTargetNode (location: (1,5)-(1,8)) │ ├── name: :bar │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 0) ├── lparen_loc: ∅ ├── rparen_loc: ∅ ├── operator_loc: (1,9)-(1,10) = "="