diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-10-23 13:43:22 -0400 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-10-26 14:59:07 -0400 |
commit | 922f48f08158332c8cf94ad37f9e307f80200bf9 (patch) | |
tree | 0514d0282daba40b7748cd77c00b9aaa70cd20bd | |
parent | 533bd1d1fa1bc0a9de1f8818b3a3275e9d50e6cc (diff) |
[ruby/prism] Remove RequiredDestructuredParameterNode in favor of MultiTargetNode
https://github.com/ruby/prism/commit/6d1858192e
30 files changed, 429 insertions, 375 deletions
diff --git a/lib/prism/debug.rb b/lib/prism/debug.rb index 6cc0feb9b8..d6f4ea3f21 100644 --- a/lib/prism/debug.rb +++ b/lib/prism/debug.rb @@ -112,11 +112,13 @@ module Prism # 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.posts.reverse) + param_stack << param.rest + param_stack.concat(param.requireds.reverse) when RequiredParameterNode sorted << param.name when SplatNode diff --git a/prism/config.yml b/prism/config.yml index 84f422c725..ac17a30ba6 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -2184,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/prism/prism.c b/prism/prism.c index 299c8cdb7f..9698019634 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -3647,6 +3647,20 @@ pm_multi_target_node_targets_append(pm_parser_t *parser, pm_multi_target_node_t } } +// 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) { @@ -4089,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) { @@ -10194,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->requireds.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; @@ -10233,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; @@ -10243,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; } diff --git a/test/prism/location_test.rb b/test/prism/location_test.rb index 3ca0ad6cfd..03a4fcc942 100644 --- a/test/prism/location_test.rb +++ b/test/prism/location_test.rb @@ -579,6 +579,9 @@ module Prism def test_MultiTargetNode assert_location(MultiTargetNode, "for foo, bar in baz do end", 4...12, &:index) assert_location(MultiTargetNode, "foo, (bar, baz) = qux", 5...15) { |node| node.requireds.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 @@ module Prism 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 diff --git a/test/prism/snapshots/methods.txt b/test/prism/snapshots/methods.txt index f3a09bb096..5ce7ea824f 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)) + │ │ │ ├── requireds: (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: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (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: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (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: ∅ + │ │ │ ├── posts: (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 f217e9bd33..64aae80ad0 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)) + │ │ │ ├── requireds: (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: ∅ + │ │ │ ├── posts: (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 8fc59bfa48..715dcdc06f 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 3232960ae0..035d5dfbbe 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)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 66364526a1..fa294367fd 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)) + │ │ │ │ ├── requireds: (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 + │ │ │ │ ├── posts: (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 5c17e68914..9cc64c6fb3 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,6)-(1,8)) + │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── posts: (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 a0f8a74bd4..3c5bd96125 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)) + │ │ │ │ ├── requireds: (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 + │ │ │ │ ├── posts: (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 d66e17e8c0..32a103bc10 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)) + │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ ├── posts: (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 b8642292c6..4646da3e0d 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)) + │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ ├── posts: (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 3010907b41..ed2b370098 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)) + │ │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ │ │ ├── posts: (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: ∅ + │ │ │ │ │ ├── posts: (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 b03d539261..eedc260842 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)) + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ │ ├── posts: (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: ∅ + │ │ │ │ ├── posts: (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 b626f21146..b40bd394c1 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)) + │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ ├── posts: (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 f86dcd3769..f897c27547 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)) + │ │ │ │ ├── requireds: (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 + │ │ │ │ ├── posts: (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 456b5531fe..fb8f73e1a9 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── posts: (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 a4a5422094..d1e467a765 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 569f28f58e..ccb83697af 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 37c1ae3700..2132b72d3e 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)) + │ │ │ │ ├── requireds: (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 + │ │ │ │ ├── posts: (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 da78704f0c..d66fd27ea2 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)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 ee0baf1471..6a085ee773 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)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (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 391bb7b3d1..09246314e5 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)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── posts: (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 285002476a..e901c3456b 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)) + │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ ├── posts: (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 2835f1f432..d8b3b55e7e 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)) + │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ ├── posts: (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/unparser/corpus/literal/block.txt b/test/prism/snapshots/unparser/corpus/literal/block.txt index e36e8116ac..c14e4bc97e 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)) + │ │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ │ ├── posts: (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)) + │ │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ │ ├── rest: + │ │ │ │ │ │ @ SplatNode (location: (35,12)-(35,13)) + │ │ │ │ │ │ ├── operator_loc: (35,12)-(35,13) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ ├── posts: (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)) + │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ └── @ MultiTargetNode (location: (38,12)-(38,15)) + │ │ │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ │ │ ├── rest: + │ │ │ │ │ │ │ @ SplatNode (location: (38,13)-(38,14)) + │ │ │ │ │ │ │ ├── operator_loc: (38,13)-(38,14) = "*" + │ │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (38,12)-(38,13) = "(" + │ │ │ │ │ │ └── rparen_loc: (38,14)-(38,15) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (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)) + │ │ │ │ │ ├── requireds: (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)) + │ │ │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ │ │ ├── rest: + │ │ │ │ │ │ │ @ SplatNode (location: (41,16)-(41,17)) + │ │ │ │ │ │ │ ├── operator_loc: (41,16)-(41,17) = "*" + │ │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (41,15)-(41,16) = "(" + │ │ │ │ │ │ └── rparen_loc: (41,17)-(41,18) = ")" + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (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)) + │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ ├── posts: (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 9c839f0784..1c12a7bd10 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)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (120,7)-(120,10)) + │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── lparen_loc: (120,7)-(120,8) = "(" + │ │ │ │ └── rparen_loc: (120,9)-(120,10) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (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/whitequark/args.txt b/test/prism/snapshots/whitequark/args.txt index 1f3a3b5c74..37c562c920 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)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ MultiTargetNode (location: (3,8)-(3,11)) + │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── lparen_loc: (3,8)-(3,9) = "(" + │ │ │ │ └── rparen_loc: (3,10)-(3,11) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (5,8)-(5,9)) + │ │ │ │ ├── operator_loc: (5,8)-(5,9) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (7,8)-(7,9)) + │ │ │ │ ├── operator_loc: (7,8)-(7,9) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (9,8)-(9,10)) + │ │ │ │ ├── operator_loc: (9,8)-(9,9) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (9,9)-(9,10)) + │ │ │ │ └── name: :r + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (11,8)-(11,10)) + │ │ │ │ ├── operator_loc: (11,8)-(11,9) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (11,9)-(11,10)) + │ │ │ │ └── name: :r + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (13,11)-(13,12)) + │ │ │ │ ├── operator_loc: (13,11)-(13,12) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (15,8)-(15,9)) + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (15,11)-(15,12)) + │ │ │ │ ├── operator_loc: (15,11)-(15,12) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (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 + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (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 + │ │ │ ├── posts: (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)) + │ │ │ ├── requireds: (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: ∅ + │ │ │ ├── posts: (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/procarg0.txt b/test/prism/snapshots/whitequark/procarg0.txt index 72652f9ef9..876d6e6f70 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)) + │ │ │ │ │ ├── requireds: (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: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ │ │ │ │ ├── posts: (length: 0) |