From 881c5a1846c220662a4ad49208a28fe0287b3c58 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 9 Jan 2024 10:12:03 -0800 Subject: [PATCH] [ruby/prism] Add a "repeated flag" to parameter nodes It's possible to repeat parameters in method definitions like so: ```ruby def foo(_a, _a) end ``` The compiler needs to know to adjust the local table size to account for these duplicate names. We'll use the repeated parameter flag to account for the extra stack space required https://github.com/ruby/prism/commit/b443cb1f60 Co-Authored-By: Kevin Newton Co-Authored-By: Jemma Issroff --- lib/prism/debug.rb | 12 +- prism/config.yml | 29 ++ prism/prism.c | 87 +++- test/prism/errors_test.rb | 64 +-- test/prism/fixtures/methods.txt | 3 - test/prism/fixtures/repeat_parameters.txt | 38 ++ test/prism/snapshots/arrays.txt | 9 + test/prism/snapshots/blocks.txt | 12 + test/prism/snapshots/break.txt | 1 + test/prism/snapshots/if.txt | 3 + test/prism/snapshots/keyword_method_names.txt | 1 + test/prism/snapshots/lambda.txt | 5 + test/prism/snapshots/method_calls.txt | 6 + test/prism/snapshots/methods.txt | 346 +++++++------ .../snapshots/non_alphanumeric_methods.txt | 2 + test/prism/snapshots/procs.txt | 28 + test/prism/snapshots/repeat_parameters.txt | 482 ++++++++++++++++++ test/prism/snapshots/rescue.txt | 1 + .../seattlerb/TestRubyParserShared.txt | 4 + .../snapshots/seattlerb/args_kw_block.txt | 2 + .../snapshots/seattlerb/block_arg__bare.txt | 1 + .../snapshots/seattlerb/block_arg_kwsplat.txt | 1 + .../seattlerb/block_arg_opt_arg_block.txt | 4 + .../seattlerb/block_arg_opt_splat.txt | 3 + .../block_arg_opt_splat_arg_block_omfg.txt | 5 + .../seattlerb/block_arg_optional.txt | 1 + .../snapshots/seattlerb/block_arg_scope.txt | 2 + .../snapshots/seattlerb/block_arg_scope2.txt | 3 + .../seattlerb/block_arg_splat_arg.txt | 3 + .../snapshots/seattlerb/block_args_kwargs.txt | 1 + .../snapshots/seattlerb/block_args_opt1.txt | 2 + .../snapshots/seattlerb/block_args_opt2.txt | 2 + .../snapshots/seattlerb/block_args_opt2_2.txt | 3 + .../snapshots/seattlerb/block_args_opt3.txt | 4 + .../prism/snapshots/seattlerb/block_break.txt | 1 + .../block_call_defn_call_block_call.txt | 1 + .../block_call_dot_op2_brace_block.txt | 1 + .../block_call_dot_op2_cmd_args_do_block.txt | 1 + .../seattlerb/block_decomp_anon_splat_arg.txt | 1 + .../seattlerb/block_decomp_arg_splat.txt | 1 + .../seattlerb/block_decomp_arg_splat_arg.txt | 3 + .../seattlerb/block_decomp_splat.txt | 1 + test/prism/snapshots/seattlerb/block_kw.txt | 1 + .../seattlerb/block_kw__required.txt | 1 + .../snapshots/seattlerb/block_kwarg_lvar.txt | 1 + .../seattlerb/block_kwarg_lvar_multiple.txt | 2 + test/prism/snapshots/seattlerb/block_next.txt | 1 + .../snapshots/seattlerb/block_opt_arg.txt | 2 + .../snapshots/seattlerb/block_opt_splat.txt | 2 + .../block_opt_splat_arg_block_omfg.txt | 4 + .../snapshots/seattlerb/block_optarg.txt | 1 + .../snapshots/seattlerb/block_paren_splat.txt | 2 + .../snapshots/seattlerb/block_reg_optarg.txt | 2 + .../snapshots/seattlerb/block_return.txt | 1 + .../prism/snapshots/seattlerb/block_scope.txt | 1 + .../snapshots/seattlerb/block_splat_reg.txt | 2 + test/prism/snapshots/seattlerb/bug236.txt | 2 + .../snapshots/seattlerb/bug_args__19.txt | 2 + .../snapshots/seattlerb/bug_args_masgn.txt | 3 + .../snapshots/seattlerb/bug_args_masgn2.txt | 4 + .../bug_args_masgn_outer_parens__19.txt | 3 + .../snapshots/seattlerb/bug_masgn_right.txt | 3 + test/prism/snapshots/seattlerb/case_in.txt | 1 + .../seattlerb/defn_arg_asplat_arg.txt | 3 + .../seattlerb/defn_arg_forward_args.txt | 1 + .../seattlerb/defn_args_forward_args.txt | 3 + .../snapshots/seattlerb/defn_kwarg_env.txt | 1 + .../snapshots/seattlerb/defn_kwarg_kwarg.txt | 3 + .../seattlerb/defn_kwarg_kwsplat.txt | 2 + .../seattlerb/defn_kwarg_kwsplat_anon.txt | 2 + .../snapshots/seattlerb/defn_kwarg_lvar.txt | 1 + .../seattlerb/defn_kwarg_no_parens.txt | 1 + .../snapshots/seattlerb/defn_kwarg_val.txt | 2 + .../snapshots/seattlerb/defn_oneliner.txt | 1 + .../snapshots/seattlerb/defn_oneliner_eq2.txt | 1 + .../seattlerb/defn_oneliner_rescue.txt | 3 + .../snapshots/seattlerb/defn_opt_last_arg.txt | 1 + .../snapshots/seattlerb/defn_opt_reg.txt | 2 + .../seattlerb/defn_opt_splat_arg.txt | 3 + .../prism/snapshots/seattlerb/defn_powarg.txt | 1 + .../snapshots/seattlerb/defn_reg_opt_reg.txt | 3 + .../snapshots/seattlerb/defn_splat_arg.txt | 2 + test/prism/snapshots/seattlerb/defs_kwarg.txt | 1 + .../snapshots/seattlerb/defs_oneliner.txt | 1 + .../snapshots/seattlerb/defs_oneliner_eq2.txt | 1 + .../seattlerb/defs_oneliner_rescue.txt | 3 + .../prism/snapshots/seattlerb/difficult3_.txt | 3 + .../snapshots/seattlerb/difficult3_2.txt | 2 + .../snapshots/seattlerb/difficult3_3.txt | 3 + .../snapshots/seattlerb/difficult3__10.txt | 3 + .../snapshots/seattlerb/difficult3__11.txt | 1 + .../snapshots/seattlerb/difficult3__12.txt | 2 + .../snapshots/seattlerb/difficult3__6.txt | 4 + .../snapshots/seattlerb/difficult3__7.txt | 2 + .../snapshots/seattlerb/difficult3__8.txt | 3 + .../snapshots/seattlerb/difficult3__9.txt | 2 + .../prism/snapshots/seattlerb/difficult6_.txt | 2 + test/prism/snapshots/seattlerb/do_bug.txt | 1 + test/prism/snapshots/seattlerb/f_kw.txt | 1 + .../snapshots/seattlerb/f_kw__required.txt | 1 + .../prism/snapshots/seattlerb/iter_args_1.txt | 2 + .../snapshots/seattlerb/iter_args_10_1.txt | 3 + .../snapshots/seattlerb/iter_args_10_2.txt | 4 + .../snapshots/seattlerb/iter_args_11_1.txt | 4 + .../snapshots/seattlerb/iter_args_11_2.txt | 5 + .../snapshots/seattlerb/iter_args_2__19.txt | 2 + .../prism/snapshots/seattlerb/iter_args_3.txt | 4 + .../prism/snapshots/seattlerb/iter_args_4.txt | 3 + .../prism/snapshots/seattlerb/iter_args_5.txt | 2 + .../prism/snapshots/seattlerb/iter_args_6.txt | 3 + .../snapshots/seattlerb/iter_args_7_1.txt | 2 + .../snapshots/seattlerb/iter_args_7_2.txt | 3 + .../snapshots/seattlerb/iter_args_8_1.txt | 3 + .../snapshots/seattlerb/iter_args_8_2.txt | 4 + .../snapshots/seattlerb/iter_args_9_1.txt | 2 + .../snapshots/seattlerb/iter_args_9_2.txt | 3 + test/prism/snapshots/seattlerb/iter_kwarg.txt | 1 + .../seattlerb/iter_kwarg_kwsplat.txt | 2 + .../seattlerb/parse_line_call_no_args.txt | 2 + .../seattlerb/parse_line_defn_complex.txt | 1 + .../parse_line_defn_no_parens_args.txt | 1 + .../parse_line_iter_call_no_parens.txt | 2 + .../seattlerb/parse_line_iter_call_parens.txt | 2 + .../snapshots/seattlerb/pipe_semicolon.txt | 1 + .../seattlerb/required_kwarg_no_value.txt | 2 + .../seattlerb/stabby_arg_no_paren.txt | 1 + .../stabby_arg_opt_splat_arg_block_omfg.txt | 5 + .../snapshots/seattlerb/stabby_block_kw.txt | 1 + .../seattlerb/stabby_block_kw__required.txt | 1 + .../snapshots/seattlerb/stabby_proc_scope.txt | 2 + .../unparser/corpus/literal/block.txt | 23 + .../snapshots/unparser/corpus/literal/def.txt | 31 ++ .../unparser/corpus/literal/defs.txt | 1 + .../unparser/corpus/literal/dstr.txt | 1 + .../snapshots/unparser/corpus/literal/if.txt | 1 + .../unparser/corpus/literal/lambda.txt | 8 + .../unparser/corpus/literal/since/31.txt | 3 + .../unparser/corpus/literal/since/32.txt | 4 + .../unparser/corpus/literal/while.txt | 3 + .../unparser/corpus/semantic/block.txt | 2 + test/prism/snapshots/while.txt | 1 + .../whitequark/anonymous_blockarg.txt | 1 + test/prism/snapshots/whitequark/arg.txt | 3 + .../whitequark/arg_duplicate_ignored.txt | 4 + test/prism/snapshots/whitequark/arg_scope.txt | 1 + test/prism/snapshots/whitequark/args.txt | 70 +++ test/prism/snapshots/whitequark/blockarg.txt | 1 + test/prism/snapshots/whitequark/blockargs.txt | 74 +++ test/prism/snapshots/whitequark/bug_435.txt | 1 + .../whitequark/bug_lambda_leakage.txt | 1 + .../whitequark/endless_comparison_method.txt | 6 + .../snapshots/whitequark/endless_method.txt | 2 + .../endless_method_command_syntax.txt | 4 + .../whitequark/forward_arg_with_open_args.txt | 7 + .../forwarded_argument_with_kwrestarg.txt | 2 + .../forwarded_argument_with_restarg.txt | 2 + .../whitequark/forwarded_kwrestarg.txt | 1 + ...warded_kwrestarg_with_additional_kwarg.txt | 1 + .../whitequark/forwarded_restarg.txt | 1 + test/prism/snapshots/whitequark/kwarg.txt | 1 + test/prism/snapshots/whitequark/kwoptarg.txt | 1 + ...targ_with_kwrestarg_and_forwarded_args.txt | 2 + .../snapshots/whitequark/kwrestarg_named.txt | 1 + .../whitequark/kwrestarg_unnamed.txt | 1 + .../method_definition_in_while_cond.txt | 2 + test/prism/snapshots/whitequark/optarg.txt | 3 + .../snapshots/whitequark/parser_bug_272.txt | 1 + .../snapshots/whitequark/parser_bug_507.txt | 1 + .../snapshots/whitequark/parser_bug_645.txt | 1 + test/prism/snapshots/whitequark/procarg0.txt | 3 + .../snapshots/whitequark/restarg_named.txt | 1 + .../snapshots/whitequark/restarg_unnamed.txt | 1 + .../snapshots/whitequark/ruby_bug_10653.txt | 1 + .../snapshots/whitequark/ruby_bug_12073.txt | 1 + .../snapshots/whitequark/ruby_bug_15789.txt | 2 + .../snapshots/whitequark/ruby_bug_9669.txt | 1 + .../snapshots/whitequark/send_lambda.txt | 1 + .../snapshots/whitequark/send_lambda_args.txt | 2 + .../whitequark/send_lambda_args_noparen.txt | 2 + .../whitequark/send_lambda_args_shadow.txt | 3 + .../whitequark/trailing_forward_arg.txt | 2 + 181 files changed, 1442 insertions(+), 218 deletions(-) create mode 100644 test/prism/fixtures/repeat_parameters.txt create mode 100644 test/prism/snapshots/repeat_parameters.txt diff --git a/lib/prism/debug.rb b/lib/prism/debug.rb index e275fe1dff..24a27d07ef 100644 --- a/lib/prism/debug.rb +++ b/lib/prism/debug.rb @@ -138,12 +138,14 @@ module Prism *params.keywords.grep(OptionalKeywordParameterNode).map(&:name), ] + sorted << AnonymousLocal if params.keywords.any? + if params.keyword_rest.is_a?(ForwardingParameterNode) sorted.push(:*, :&, :"...") + elsif params.keyword_rest.is_a?(KeywordRestParameterNode) + sorted << params.keyword_rest.name if params.keyword_rest.name end - sorted << AnonymousLocal if params.keywords.any? - # 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(MultiTargetNode).reverse @@ -151,15 +153,17 @@ module Prism case param when MultiTargetNode param_stack.concat(param.rights.reverse) - param_stack << param.rest + param_stack << param.rest if param.rest&.expression && !sorted.include?(param.rest.expression.name) param_stack.concat(param.lefts.reverse) when RequiredParameterNode sorted << param.name when SplatNode - sorted << param.expression.name if param.expression + sorted << param.expression.name end end + sorted << params.block.name if params.block&.name + names = sorted.concat(names - sorted) end diff --git a/prism/config.yml b/prism/config.yml index 6af11159f7..748729ec6b 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -378,6 +378,11 @@ flags: - name: BEGIN_MODIFIER comment: "a loop after a begin statement, so the body is executed first before the condition" comment: Flags for while and until loop nodes. + - name: ParameterFlags + values: + - name: REPEATED_PARAMETER + comment: "a parameter name that has been repeated in the method signature" + comment: Flags for parameter nodes. - name: RangeFlags values: - name: EXCLUDE_END @@ -648,6 +653,9 @@ nodes: ^^^^^^^^^^ - name: BlockLocalVariableNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant comment: | @@ -676,6 +684,9 @@ nodes: ^^^^^^^^^^^^^^ - name: BlockParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant? - name: name_loc @@ -1923,6 +1934,9 @@ nodes: ^^^^ - name: KeywordRestParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant? - name: name_loc @@ -2221,6 +2235,9 @@ nodes: ^^ - name: OptionalKeywordParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant - name: name_loc @@ -2235,6 +2252,9 @@ nodes: end - name: OptionalParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant - name: name_loc @@ -2451,6 +2471,9 @@ nodes: ^^^^^^ - name: RequiredKeywordParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant - name: name_loc @@ -2463,6 +2486,9 @@ nodes: end - name: RequiredParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant comment: | @@ -2514,6 +2540,9 @@ nodes: `ex` is in the `exception` field. - name: RestParameterNode fields: + - name: flags + type: flags + kind: ParameterFlags - name: name type: constant? - name: name_loc diff --git a/prism/prism.c b/prism/prism.c index 7ff50630ce..73a35c4d46 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -887,6 +887,27 @@ pm_node_flag_unset(pm_node_t *node, pm_node_flags_t flag) { node->flags &= (pm_node_flags_t) ~flag; } +/** + * Set the repeated parameter flag on the given node. + */ +static inline void +pm_node_flag_set_repeated_parameter(pm_node_t *node) { + switch (PM_NODE_TYPE(node)) { + case PM_BLOCK_LOCAL_VARIABLE_NODE: + case PM_BLOCK_PARAMETER_NODE: + case PM_KEYWORD_REST_PARAMETER_NODE: + case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: + case PM_OPTIONAL_PARAMETER_NODE: + case PM_REQUIRED_KEYWORD_PARAMETER_NODE: + case PM_REQUIRED_PARAMETER_NODE: + case PM_REST_PARAMETER_NODE: + pm_node_flag_set(node, PM_PARAMETER_FLAGS_REPEATED_PARAMETER); + break; + default: + fprintf(stderr, "unhandled type %d\n", PM_NODE_TYPE(node)); + abort(); + }; +} /******************************************************************************/ /* Node creation functions */ @@ -5996,22 +6017,24 @@ pm_parser_local_add_owned(pm_parser_t *parser, const uint8_t *start, size_t leng * Add a parameter name to the current scope and check whether the name of the * parameter is unique or not. */ -static void +static bool pm_parser_parameter_name_check(pm_parser_t *parser, const pm_token_t *name) { // We want to check whether the parameter name is a numbered parameter or // not. pm_refute_numbered_parameter(parser, name->start, name->end); - // We want to ignore any parameter name that starts with an underscore. - if ((name->start < name->end) && (*name->start == '_')) return; - // Otherwise we'll fetch the constant id for the parameter name and check // whether it's already in the current scope. pm_constant_id_t constant_id = pm_parser_constant_id_token(parser, name); if (pm_constant_id_list_includes(&parser->current_scope->locals, constant_id)) { - pm_parser_err_token(parser, name, PM_ERR_PARAMETER_NAME_REPEAT); + // Add an error if the parameter doesn't start with _ and has been seen before + if ((name->start < name->end) && (*name->start != '_')) { + pm_parser_err_token(parser, name, PM_ERR_PARAMETER_NAME_REPEAT); + } + return true; } + return false; } /** @@ -11466,7 +11489,9 @@ parse_required_destructured_parameter(pm_parser_t *parser) { if (accept1(parser, PM_TOKEN_IDENTIFIER)) { pm_token_t name = parser->previous; value = (pm_node_t *) pm_required_parameter_node_create(parser, &name); - pm_parser_parameter_name_check(parser, &name); + if (pm_parser_parameter_name_check(parser, &name)) { + pm_node_flag_set_repeated_parameter(value); + } pm_parser_local_add_token(parser, &name); } @@ -11476,7 +11501,9 @@ parse_required_destructured_parameter(pm_parser_t *parser) { pm_token_t name = parser->previous; param = (pm_node_t *) pm_required_parameter_node_create(parser, &name); - pm_parser_parameter_name_check(parser, &name); + if (pm_parser_parameter_name_check(parser, &name)) { + pm_node_flag_set_repeated_parameter(param); + } pm_parser_local_add_token(parser, &name); } @@ -11593,9 +11620,10 @@ parse_parameters( pm_token_t operator = parser->previous; pm_token_t name; + bool repeated = false; if (accept1(parser, PM_TOKEN_IDENTIFIER)) { name = parser->previous; - pm_parser_parameter_name_check(parser, &name); + repeated = pm_parser_parameter_name_check(parser, &name); pm_parser_local_add_token(parser, &name); } else { name = not_provided(parser); @@ -11606,6 +11634,9 @@ parse_parameters( } pm_block_parameter_node_t *param = pm_block_parameter_node_create(parser, &name, &operator); + if (repeated) { + pm_node_flag_set_repeated_parameter((pm_node_t *)param); + } if (params->block == NULL) { pm_parameters_node_block_set(params, param); } else { @@ -11678,7 +11709,7 @@ parse_parameters( } pm_token_t name = parser->previous; - pm_parser_parameter_name_check(parser, &name); + bool repeated = pm_parser_parameter_name_check(parser, &name); pm_parser_local_add_token(parser, &name); if (accept1(parser, PM_TOKEN_EQUAL)) { @@ -11689,6 +11720,9 @@ parse_parameters( pm_node_t *value = parse_value_expression(parser, binding_power, false, PM_ERR_PARAMETER_NO_DEFAULT); pm_optional_parameter_node_t *param = pm_optional_parameter_node_create(parser, &name, &operator, value); + if (repeated) { + pm_node_flag_set_repeated_parameter((pm_node_t *)param); + } pm_parameters_node_optionals_append(params, param); parser->current_param_name = old_param_name; @@ -11703,9 +11737,15 @@ parse_parameters( } } else if (order > PM_PARAMETERS_ORDER_AFTER_OPTIONAL) { pm_required_parameter_node_t *param = pm_required_parameter_node_create(parser, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter((pm_node_t *)param); + } pm_parameters_node_requireds_append(params, (pm_node_t *) param); } else { pm_required_parameter_node_t *param = pm_required_parameter_node_create(parser, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter((pm_node_t *)param); + } pm_parameters_node_posts_append(params, (pm_node_t *) param); } @@ -11720,7 +11760,7 @@ parse_parameters( pm_token_t local = name; local.end -= 1; - pm_parser_parameter_name_check(parser, &local); + bool repeated = pm_parser_parameter_name_check(parser, &local); pm_parser_local_add_token(parser, &local); switch (parser->current.type) { @@ -11728,6 +11768,9 @@ parse_parameters( case PM_TOKEN_PARENTHESIS_RIGHT: case PM_TOKEN_PIPE: { pm_node_t *param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter(param); + } pm_parameters_node_keywords_append(params, param); break; } @@ -11739,6 +11782,9 @@ parse_parameters( } pm_node_t *param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter(param); + } pm_parameters_node_keywords_append(params, param); break; } @@ -11758,6 +11804,9 @@ parse_parameters( param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); } + if (repeated) { + pm_node_flag_set_repeated_parameter(param); + } pm_parameters_node_keywords_append(params, param); // If parsing the value of the parameter resulted in error recovery, @@ -11780,10 +11829,10 @@ parse_parameters( pm_token_t operator = parser->previous; pm_token_t name; - + bool repeated = false; if (accept1(parser, PM_TOKEN_IDENTIFIER)) { name = parser->previous; - pm_parser_parameter_name_check(parser, &name); + repeated = pm_parser_parameter_name_check(parser, &name); pm_parser_local_add_token(parser, &name); } else { name = not_provided(parser); @@ -11794,6 +11843,9 @@ parse_parameters( } pm_node_t *param = (pm_node_t *) pm_rest_parameter_node_create(parser, &operator, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter(param); + } if (params->rest == NULL) { pm_parameters_node_rest_set(params, param); } else { @@ -11816,9 +11868,10 @@ parse_parameters( } else { pm_token_t name; + bool repeated = false; if (accept1(parser, PM_TOKEN_IDENTIFIER)) { name = parser->previous; - pm_parser_parameter_name_check(parser, &name); + repeated = pm_parser_parameter_name_check(parser, &name); pm_parser_local_add_token(parser, &name); } else { name = not_provided(parser); @@ -11829,6 +11882,9 @@ parse_parameters( } param = (pm_node_t *) pm_keyword_rest_parameter_node_create(parser, &operator, &name); + if (repeated) { + pm_node_flag_set_repeated_parameter(param); + } } if (params->keyword_rest == NULL) { @@ -12064,10 +12120,13 @@ parse_block_parameters( if ((opening->type != PM_TOKEN_NOT_PROVIDED) && accept1(parser, PM_TOKEN_SEMICOLON)) { do { expect1(parser, PM_TOKEN_IDENTIFIER, PM_ERR_BLOCK_PARAM_LOCAL_VARIABLE); - pm_parser_parameter_name_check(parser, &parser->previous); + bool repeated = pm_parser_parameter_name_check(parser, &parser->previous); pm_parser_local_add_token(parser, &parser->previous); pm_block_local_variable_node_t *local = pm_block_local_variable_node_create(parser, &parser->previous); + if (repeated) { + pm_node_flag_set_repeated_parameter((pm_node_t *)local); + } pm_block_parameters_node_append_local(block_parameters, local); } while (accept1(parser, PM_TOKEN_COMMA)); } diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 2c981fbd42..d1af9a5dae 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -566,10 +566,10 @@ module Prism Location(), nil, ParametersNode([ - RequiredParameterNode(:A), - RequiredParameterNode(:@a), - RequiredParameterNode(:$A), - RequiredParameterNode(:@@a), + RequiredParameterNode(0, :A), + RequiredParameterNode(0, :@a), + RequiredParameterNode(0, :$A), + RequiredParameterNode(0, :@@a), ], [], nil, [], [], nil, nil), nil, [:A, :@a, :$A, :@@a], @@ -635,7 +635,7 @@ module Prism Location(), nil, ParametersNode( - [RequiredParameterNode(:a), RequiredParameterNode(:b), RequiredParameterNode(:c)], + [RequiredParameterNode(0, :a), RequiredParameterNode(0, :b), RequiredParameterNode(0, :c)], [], nil, [], @@ -667,7 +667,7 @@ module Prism Location(), Location(), BlockParametersNode( - ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], nil, [], [], nil, nil), + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], nil, nil), [], Location(), Location() @@ -724,10 +724,10 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], + [RequiredParameterNode(0, :a)], [], nil, - BlockParameterNode(:block, Location(), Location()) + BlockParameterNode(0, :block, Location(), Location()) ), nil, [:block, :a], @@ -749,7 +749,7 @@ module Prism :foo, Location(), nil, - ParametersNode([], [], nil, [RequiredParameterNode(:a)], [], nil, BlockParameterNode(nil, nil, Location())), + ParametersNode([], [], nil, [RequiredParameterNode(0, :a)], [], nil, BlockParameterNode(0, nil, nil, Location())), nil, [:&, :a], 2, @@ -775,7 +775,7 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], + [RequiredParameterNode(0, :a)], [], ForwardingParameterNode(), nil @@ -804,8 +804,8 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], - [RequiredKeywordParameterNode(:b, Location())], + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], nil, nil ), @@ -834,8 +834,8 @@ module Prism [], nil, [], - [RequiredKeywordParameterNode(:b, Location())], - KeywordRestParameterNode(:rest, Location(), Location()), + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :rest, Location(), Location()), nil ), nil, @@ -885,9 +885,9 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], - [RequiredKeywordParameterNode(:b, Location())], - KeywordRestParameterNode(:args, Location(), Location()), + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), nil ), nil, @@ -916,9 +916,9 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], - [RequiredKeywordParameterNode(:b, Location())], - KeywordRestParameterNode(:args, Location(), Location()), + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), nil ), nil, @@ -947,9 +947,9 @@ module Prism [], [], nil, - [RequiredParameterNode(:a)], - [RequiredKeywordParameterNode(:b, Location())], - KeywordRestParameterNode(:args, Location(), Location()), + [RequiredParameterNode(0, :a)], + [RequiredKeywordParameterNode(0, :b, Location())], + KeywordRestParameterNode(0, :args, Location(), Location()), nil ), nil, @@ -975,13 +975,13 @@ module Prism Location(), nil, ParametersNode( - [RequiredParameterNode(:a)], + [RequiredParameterNode(0, :a)], [ - OptionalParameterNode(:b, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL)), - OptionalParameterNode(:d, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL)) + OptionalParameterNode(0, :b, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL)), + OptionalParameterNode(0, :d, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL)) ], nil, - [RequiredParameterNode(:c), RequiredParameterNode(:e)], + [RequiredParameterNode(0, :c), RequiredParameterNode(0, :e)], [], nil, nil @@ -1152,7 +1152,7 @@ module Prism :foo, Location(), nil, - ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b), RequiredParameterNode(:a)], [], nil, [], [], nil, nil), + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b), RequiredParameterNode(ParameterFlags::REPEATED_PARAMETER, :a)], [], nil, [], [], nil, nil), nil, [:a, :b], 2, @@ -1173,7 +1173,7 @@ module Prism :foo, Location(), nil, - ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], RestParameterNode(:a, Location(), Location()), [], [], nil, nil), + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], RestParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location()), [], [], nil, nil), nil, [:a, :b], 2, @@ -1193,7 +1193,7 @@ module Prism :foo, Location(), nil, - ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], nil, [], [], KeywordRestParameterNode(:a, Location(), Location()), nil), + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], KeywordRestParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location()), nil), nil, [:a, :b], 2, @@ -1213,7 +1213,7 @@ module Prism :foo, Location(), nil, - ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], nil, [], [], nil, BlockParameterNode(:a, Location(), Location())), + ParametersNode([RequiredParameterNode(0, :a), RequiredParameterNode(0, :b)], [], nil, [], [], nil, BlockParameterNode(ParameterFlags::REPEATED_PARAMETER, :a, Location(), Location())), nil, [:a, :b], 2, @@ -1233,7 +1233,7 @@ module Prism :foo, Location(), nil, - ParametersNode([], [OptionalParameterNode(:a, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL))], RestParameterNode(:c, Location(), Location()), [RequiredParameterNode(:b)], [], nil, nil), + ParametersNode([], [OptionalParameterNode(0, :a, Location(), Location(), IntegerNode(IntegerBaseFlags::DECIMAL))], RestParameterNode(0, :c, Location(), Location()), [RequiredParameterNode(0, :b)], [], nil, nil), nil, [:a, :b, :c], 3, diff --git a/test/prism/fixtures/methods.txt b/test/prism/fixtures/methods.txt index 703527f2de..0d2286056f 100644 --- a/test/prism/fixtures/methods.txt +++ b/test/prism/fixtures/methods.txt @@ -161,9 +161,6 @@ def method(a) item >> a {} end -def foo(_a, _a, b, c) -end - foo = 1 def foo.bar; end diff --git a/test/prism/fixtures/repeat_parameters.txt b/test/prism/fixtures/repeat_parameters.txt new file mode 100644 index 0000000000..9c69e9718a --- /dev/null +++ b/test/prism/fixtures/repeat_parameters.txt @@ -0,0 +1,38 @@ +def foo(a, _) +end + +def foo(a, _, _) +end + +def foo(a, _, _, _b) +end + +def foo(a, _, _, _b, _b) +end + +def foo(a, (b, *_c, d), (e, *_c, f)) +end + +def foo(_a, _a, b, c) +end + +def foo((a, *_b, c), (d, *_b, e)) +end + +def foo(_a = 1, _a = 2) +end + +def foo(_a:, _a:) +end + +def foo(_a: 1, _a: 2) +end + +def foo(_a, **_a) +end + +def foo(_a, &_a) +end + +def foo(_a, *_a) +end diff --git a/test/prism/snapshots/arrays.txt b/test/prism/snapshots/arrays.txt index 7f58faaed5..c1b2913461 100644 --- a/test/prism/snapshots/arrays.txt +++ b/test/prism/snapshots/arrays.txt @@ -1031,6 +1031,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (88,8)-(88,9)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (88,8)-(88,9) = "&" @@ -1809,6 +1810,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (128,6)-(128,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (128,6)-(128,7) = "*" @@ -1863,6 +1865,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (130,6)-(130,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (130,6)-(130,7) = "*" @@ -1919,6 +1922,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (132,6)-(132,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (132,6)-(132,7) = "*" @@ -1975,6 +1979,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (134,6)-(134,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (134,6)-(134,7) = "*" @@ -2033,6 +2038,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (136,6)-(136,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (136,6)-(136,7) = "*" @@ -2090,6 +2096,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (138,6)-(138,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (138,6)-(138,7) = "*" @@ -2148,6 +2155,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (140,6)-(140,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (140,6)-(140,7) = "*" @@ -2211,6 +2219,7 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (142,6)-(142,7)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (142,6)-(142,7) = "*" diff --git a/test/prism/snapshots/blocks.txt b/test/prism/snapshots/blocks.txt index 9d560d4016..577a11ab16 100644 --- a/test/prism/snapshots/blocks.txt +++ b/test/prism/snapshots/blocks.txt @@ -141,8 +141,10 @@ │ │ │ @ ParametersNode (location: (7,15)-(7,22)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (7,15)-(7,16)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :x │ │ │ │ └── @ RequiredParameterNode (location: (7,18)-(7,22)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :memo │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -324,6 +326,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (17,8)-(17,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (17,8)-(17,9) = "a" │ │ │ │ ├── operator_loc: (17,10)-(17,11) = "=" @@ -521,9 +524,11 @@ │ │ │ @ ParametersNode (location: (33,7)-(33,19)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (33,7)-(33,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (33,10)-(33,15)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :y │ │ │ │ ├── name_loc: (33,10)-(33,11) = "y" │ │ │ │ ├── operator_loc: (33,12)-(33,13) = "=" @@ -534,6 +539,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ RequiredKeywordParameterNode (location: (33,17)-(33,19)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :z │ │ │ │ └── name_loc: (33,17)-(33,19) = "z:" │ │ │ ├── keyword_rest: ∅ @@ -568,6 +574,7 @@ │ │ │ @ ParametersNode (location: (35,7)-(35,8)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (35,7)-(35,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -608,6 +615,7 @@ │ │ │ @ ParametersNode (location: (38,9)-(38,10)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (38,9)-(38,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -640,6 +648,7 @@ │ │ │ @ ParametersNode (location: (41,8)-(41,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (41,8)-(41,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -721,12 +730,14 @@ │ │ │ │ ├── posts: (length: 0) │ │ │ │ ├── keywords: (length: 2) │ │ │ │ │ ├── @ OptionalKeywordParameterNode (location: (49,2)-(49,6)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ ├── name: :a │ │ │ │ │ │ ├── name_loc: (49,2)-(49,4) = "a:" │ │ │ │ │ │ └── value: │ │ │ │ │ │ @ IntegerNode (location: (49,5)-(49,6)) │ │ │ │ │ │ └── flags: decimal │ │ │ │ │ └── @ OptionalKeywordParameterNode (location: (50,2)-(50,6)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :b │ │ │ │ │ ├── name_loc: (50,2)-(50,4) = "b:" │ │ │ │ │ └── value: @@ -761,6 +772,7 @@ │ │ @ ParametersNode (location: (54,8)-(54,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (54,8)-(54,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: diff --git a/test/prism/snapshots/break.txt b/test/prism/snapshots/break.txt index 30b15e4754..c30231c02d 100644 --- a/test/prism/snapshots/break.txt +++ b/test/prism/snapshots/break.txt @@ -189,6 +189,7 @@ │ │ │ @ ParametersNode (location: (25,7)-(25,8)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (25,7)-(25,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/if.txt b/test/prism/snapshots/if.txt index f2166052a5..ae3df9719b 100644 --- a/test/prism/snapshots/if.txt +++ b/test/prism/snapshots/if.txt @@ -356,6 +356,7 @@ │ │ │ @ ParametersNode (location: (34,13)-(34,14)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (34,13)-(34,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :_ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -398,6 +399,7 @@ │ │ │ │ @ ParametersNode (location: (37,13)-(37,14)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (37,13)-(37,14)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :_ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ @@ -436,6 +438,7 @@ │ │ │ │ │ @ ParametersNode (location: (40,13)-(40,14)) │ │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ │ └── @ RequiredParameterNode (location: (40,13)-(40,14)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :_ │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/keyword_method_names.txt b/test/prism/snapshots/keyword_method_names.txt index afaff8d604..3fdf69971d 100644 --- a/test/prism/snapshots/keyword_method_names.txt +++ b/test/prism/snapshots/keyword_method_names.txt @@ -86,6 +86,7 @@ │ │ @ ParametersNode (location: (12,6)-(12,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (12,6)-(12,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/lambda.txt b/test/prism/snapshots/lambda.txt index eb7c12dc5b..05e803c62b 100644 --- a/test/prism/snapshots/lambda.txt +++ b/test/prism/snapshots/lambda.txt @@ -15,6 +15,7 @@ │ │ │ @ ParametersNode (location: (2,2)-(2,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (2,2)-(2,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :foo │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -42,6 +43,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ OptionalKeywordParameterNode (location: (5,3)-(5,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :x │ │ │ │ ├── name_loc: (5,3)-(5,5) = "x:" │ │ │ │ └── value: @@ -93,6 +95,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ OptionalKeywordParameterNode (location: (7,3)-(7,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (7,3)-(7,5) = "a:" │ │ │ │ └── value: @@ -140,6 +143,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (9,3)-(9,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :foo │ │ │ │ ├── name_loc: (9,3)-(9,6) = "foo" │ │ │ │ ├── operator_loc: (9,7)-(9,8) = "=" @@ -179,6 +183,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (11,3)-(11,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ ├── name_loc: (11,3)-(11,7) = "foo:" │ │ │ └── value: diff --git a/test/prism/snapshots/method_calls.txt b/test/prism/snapshots/method_calls.txt index fdebd48d5a..0828a65a34 100644 --- a/test/prism/snapshots/method_calls.txt +++ b/test/prism/snapshots/method_calls.txt @@ -938,8 +938,10 @@ │ │ │ @ ParametersNode (location: (64,20)-(64,24)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (64,20)-(64,21)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (64,23)-(64,24)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -1932,6 +1934,7 @@ │ │ │ │ │ @ ParametersNode (location: (121,12)-(121,13)) │ │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ │ └── @ RequiredParameterNode (location: (121,12)-(121,13)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :a │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ ├── rest: ∅ @@ -2008,6 +2011,7 @@ │ │ │ │ │ @ ParametersNode (location: (128,12)-(128,13)) │ │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ │ └── @ RequiredParameterNode (location: (128,12)-(128,13)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :a │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ ├── rest: ∅ @@ -2131,6 +2135,7 @@ │ │ │ │ @ ParametersNode (location: (139,10)-(139,11)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (139,10)-(139,11)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ @@ -2309,6 +2314,7 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (149,6)-(149,7)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (149,6)-(149,7) = "*" diff --git a/test/prism/snapshots/methods.txt b/test/prism/snapshots/methods.txt index 225f27e178..9e0e0548e8 100644 --- a/test/prism/snapshots/methods.txt +++ b/test/prism/snapshots/methods.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(186,37)) +@ ProgramNode (location: (1,0)-(183,37)) ├── locals: [:a, :c, :foo] └── statements: - @ StatementsNode (location: (1,0)-(186,37)) - └── body: (length: 70) + @ StatementsNode (location: (1,0)-(183,37)) + └── body: (length: 69) ├── @ DefNode (location: (1,0)-(2,3)) │ ├── name: :foo │ ├── name_loc: (1,4)-(1,7) = "foo" @@ -13,8 +13,10 @@ │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :bar │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :baz │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) @@ -45,8 +47,10 @@ │ │ │ └── @ MultiTargetNode (location: (4,8)-(4,18)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (4,9)-(4,12)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :bar │ │ │ │ └── @ RequiredParameterNode (location: (4,14)-(4,17)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :baz │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) @@ -54,6 +58,7 @@ │ │ │ └── rparen_loc: (4,17)-(4,18) = ")" │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (4,20)-(4,32)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :optional │ │ │ ├── name_loc: (4,20)-(4,28) = "optional" │ │ │ ├── operator_loc: (4,29)-(4,30) = "=" @@ -65,8 +70,10 @@ │ │ │ └── @ MultiTargetNode (location: (4,34)-(4,44)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (4,35)-(4,38)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :bin │ │ │ │ └── @ RequiredParameterNode (location: (4,40)-(4,43)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :bag │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) @@ -271,6 +278,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (31,6)-(31,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ └── name_loc: (31,6)-(31,8) = "b:" │ │ ├── keyword_rest: ∅ @@ -302,6 +310,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (35,6)-(35,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ └── name_loc: (35,6)-(35,8) = "b:" │ │ ├── keyword_rest: ∅ @@ -328,6 +337,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (38,6)-(38,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (38,8)-(38,9) = "b" │ │ │ └── operator_loc: (38,6)-(38,8) = "**" @@ -354,6 +364,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (41,6)-(41,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (41,6)-(41,8) = "**" @@ -397,10 +408,13 @@ │ │ @ ParametersNode (location: (47,6)-(47,13)) │ │ ├── requireds: (length: 3) │ │ │ ├── @ RequiredParameterNode (location: (47,6)-(47,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── @ RequiredParameterNode (location: (47,9)-(47,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ └── @ RequiredParameterNode (location: (47,12)-(47,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -444,9 +458,11 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ RequiredKeywordParameterNode (location: (53,6)-(53,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ └── name_loc: (53,6)-(53,8) = "b:" │ │ │ └── @ OptionalKeywordParameterNode (location: (53,10)-(53,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (53,10)-(53,12) = "c:" │ │ │ └── value: @@ -475,9 +491,11 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ RequiredKeywordParameterNode (location: (56,6)-(56,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ └── name_loc: (56,6)-(56,8) = "b:" │ │ │ └── @ OptionalKeywordParameterNode (location: (56,10)-(56,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (56,10)-(56,12) = "c:" │ │ │ └── value: @@ -506,12 +524,14 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ OptionalKeywordParameterNode (location: (59,6)-(60,3)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (59,6)-(59,8) = "b:" │ │ │ │ └── value: │ │ │ │ @ IntegerNode (location: (60,2)-(60,3)) │ │ │ │ └── flags: decimal │ │ │ └── @ RequiredKeywordParameterNode (location: (60,5)-(60,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ └── name_loc: (60,5)-(60,7) = "c:" │ │ ├── keyword_rest: ∅ @@ -540,6 +560,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 2) │ │ │ ├── @ OptionalParameterNode (location: (65,6)-(65,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (65,6)-(65,7) = "b" │ │ │ │ ├── operator_loc: (65,8)-(65,9) = "=" @@ -547,6 +568,7 @@ │ │ │ │ @ IntegerNode (location: (65,10)-(65,11)) │ │ │ │ └── flags: decimal │ │ │ └── @ OptionalParameterNode (location: (65,13)-(65,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (65,13)-(65,14) = "c" │ │ │ ├── operator_loc: (65,15)-(65,16) = "=" @@ -589,9 +611,11 @@ │ │ @ ParametersNode (location: (71,6)-(71,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (71,6)-(71,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (71,9)-(71,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (71,9)-(71,10) = "c" │ │ │ ├── operator_loc: (71,11)-(71,12) = "=" @@ -620,6 +644,7 @@ │ │ @ ParametersNode (location: (74,6)-(74,7)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (74,6)-(74,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -682,6 +707,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (79,6)-(79,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (79,7)-(79,8) = "b" │ │ │ └── operator_loc: (79,6)-(79,7) = "*" @@ -708,6 +734,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (82,6)-(82,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (82,6)-(82,7) = "*" @@ -880,6 +907,7 @@ │ │ @ ParametersNode (location: (106,8)-(106,11)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (106,8)-(106,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -928,6 +956,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (110,6)-(110,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (110,6)-(110,7) = "*" @@ -1092,6 +1121,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (119,6)-(119,8)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (119,7)-(119,8) = "b" │ │ └── operator_loc: (119,6)-(119,7) = "&" @@ -1118,6 +1148,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (122,6)-(122,7)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (122,6)-(122,7) = "&" @@ -1360,6 +1391,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (142,8)-(142,19)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (142,8)-(142,10) = "a:" │ │ │ └── value: @@ -1401,6 +1433,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (145,8)-(145,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (145,8)-(145,10) = "a:" │ │ │ └── value: @@ -1440,6 +1473,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (148,8)-(148,17)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (148,8)-(148,10) = "a:" │ │ │ └── value: @@ -1476,6 +1510,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (151,8)-(151,20)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (151,8)-(151,9) = "a" │ │ │ ├── operator_loc: (151,10)-(151,11) = "=" @@ -1518,6 +1553,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (154,8)-(154,19)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (154,8)-(154,9) = "a" │ │ │ ├── operator_loc: (154,10)-(154,11) = "=" @@ -1558,6 +1594,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (157,8)-(157,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (157,8)-(157,9) = "a" │ │ │ ├── operator_loc: (157,10)-(157,11) = "=" @@ -1597,6 +1634,7 @@ │ │ @ ParametersNode (location: (160,11)-(160,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (160,11)-(160,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -1655,128 +1693,100 @@ │ ├── rparen_loc: (160,12)-(160,13) = ")" │ ├── equal_loc: ∅ │ └── end_keyword_loc: (162,0)-(162,3) = "end" - ├── @ DefNode (location: (164,0)-(165,3)) - │ ├── name: :foo - │ ├── name_loc: (164,4)-(164,7) = "foo" - │ ├── receiver: ∅ - │ ├── parameters: - │ │ @ ParametersNode (location: (164,8)-(164,20)) - │ │ ├── requireds: (length: 4) - │ │ │ ├── @ RequiredParameterNode (location: (164,8)-(164,10)) - │ │ │ │ └── name: :_a - │ │ │ ├── @ RequiredParameterNode (location: (164,12)-(164,14)) - │ │ │ │ └── name: :_a - │ │ │ ├── @ RequiredParameterNode (location: (164,16)-(164,17)) - │ │ │ │ └── name: :b - │ │ │ └── @ RequiredParameterNode (location: (164,19)-(164,20)) - │ │ │ └── name: :c - │ │ ├── optionals: (length: 0) - │ │ ├── rest: ∅ - │ │ ├── posts: (length: 0) - │ │ ├── keywords: (length: 0) - │ │ ├── keyword_rest: ∅ - │ │ └── block: ∅ - │ ├── body: ∅ - │ ├── locals: [:_a, :b, :c] - │ ├── locals_body_index: 3 - │ ├── def_keyword_loc: (164,0)-(164,3) = "def" - │ ├── operator_loc: ∅ - │ ├── lparen_loc: (164,7)-(164,8) = "(" - │ ├── rparen_loc: (164,20)-(164,21) = ")" - │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (165,0)-(165,3) = "end" - ├── @ LocalVariableWriteNode (location: (167,0)-(167,7)) + ├── @ LocalVariableWriteNode (location: (164,0)-(164,7)) │ ├── name: :foo │ ├── depth: 0 - │ ├── name_loc: (167,0)-(167,3) = "foo" + │ ├── name_loc: (164,0)-(164,3) = "foo" │ ├── value: - │ │ @ IntegerNode (location: (167,6)-(167,7)) + │ │ @ IntegerNode (location: (164,6)-(164,7)) │ │ └── flags: decimal - │ └── operator_loc: (167,4)-(167,5) = "=" - ├── @ DefNode (location: (168,0)-(168,16)) + │ └── operator_loc: (164,4)-(164,5) = "=" + ├── @ DefNode (location: (165,0)-(165,16)) │ ├── name: :bar - │ ├── name_loc: (168,8)-(168,11) = "bar" + │ ├── name_loc: (165,8)-(165,11) = "bar" │ ├── receiver: - │ │ @ LocalVariableReadNode (location: (168,4)-(168,7)) + │ │ @ LocalVariableReadNode (location: (165,4)-(165,7)) │ │ ├── name: :foo │ │ └── depth: 0 │ ├── parameters: ∅ │ ├── body: ∅ │ ├── locals: [] │ ├── locals_body_index: 0 - │ ├── def_keyword_loc: (168,0)-(168,3) = "def" - │ ├── operator_loc: (168,7)-(168,8) = "." + │ ├── def_keyword_loc: (165,0)-(165,3) = "def" + │ ├── operator_loc: (165,7)-(165,8) = "." │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (168,13)-(168,16) = "end" - ├── @ DefNode (location: (170,0)-(170,18)) + │ └── end_keyword_loc: (165,13)-(165,16) = "end" + ├── @ DefNode (location: (167,0)-(167,18)) │ ├── name: :f - │ ├── name_loc: (170,4)-(170,5) = "f" + │ ├── name_loc: (167,4)-(167,5) = "f" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (170,6)-(170,7)) + │ │ @ ParametersNode (location: (167,6)-(167,7)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: - │ │ │ @ RestParameterNode (location: (170,6)-(170,7)) + │ │ │ @ RestParameterNode (location: (167,6)-(167,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ - │ │ │ └── operator_loc: (170,6)-(170,7) = "*" + │ │ │ └── operator_loc: (167,6)-(167,7) = "*" │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ │ ├── body: - │ │ @ StatementsNode (location: (170,10)-(170,13)) + │ │ @ StatementsNode (location: (167,10)-(167,13)) │ │ └── body: (length: 1) - │ │ └── @ ArrayNode (location: (170,10)-(170,13)) + │ │ └── @ ArrayNode (location: (167,10)-(167,13)) │ │ ├── flags: contains_splat │ │ ├── elements: (length: 1) - │ │ │ └── @ SplatNode (location: (170,11)-(170,12)) - │ │ │ ├── operator_loc: (170,11)-(170,12) = "*" + │ │ │ └── @ SplatNode (location: (167,11)-(167,12)) + │ │ │ ├── operator_loc: (167,11)-(167,12) = "*" │ │ │ └── expression: ∅ - │ │ ├── opening_loc: (170,10)-(170,11) = "[" - │ │ └── closing_loc: (170,12)-(170,13) = "]" + │ │ ├── opening_loc: (167,10)-(167,11) = "[" + │ │ └── closing_loc: (167,12)-(167,13) = "]" │ ├── locals: [:*] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (170,0)-(170,3) = "def" + │ ├── def_keyword_loc: (167,0)-(167,3) = "def" │ ├── operator_loc: ∅ - │ ├── lparen_loc: (170,5)-(170,6) = "(" - │ ├── rparen_loc: (170,7)-(170,8) = ")" + │ ├── lparen_loc: (167,5)-(167,6) = "(" + │ ├── rparen_loc: (167,7)-(167,8) = ")" │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (170,15)-(170,18) = "end" - ├── @ DefNode (location: (172,0)-(172,15)) + │ └── end_keyword_loc: (167,15)-(167,18) = "end" + ├── @ DefNode (location: (169,0)-(169,15)) │ ├── name: :f - │ ├── name_loc: (172,4)-(172,5) = "f" + │ ├── name_loc: (169,4)-(169,5) = "f" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (172,6)-(172,10)) + │ │ @ ParametersNode (location: (169,6)-(169,10)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) - │ │ │ └── @ OptionalKeywordParameterNode (location: (172,6)-(172,10)) + │ │ │ └── @ OptionalKeywordParameterNode (location: (169,6)-(169,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :x - │ │ │ ├── name_loc: (172,6)-(172,8) = "x:" + │ │ │ ├── name_loc: (169,6)-(169,8) = "x:" │ │ │ └── value: - │ │ │ @ CallNode (location: (172,8)-(172,10)) + │ │ │ @ CallNode (location: (169,8)-(169,10)) │ │ │ ├── flags: ∅ │ │ │ ├── receiver: - │ │ │ │ @ CallNode (location: (172,9)-(172,10)) + │ │ │ │ @ CallNode (location: (169,9)-(169,10)) │ │ │ │ ├── flags: variable_call, ignore_visibility │ │ │ │ ├── receiver: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :a - │ │ │ │ ├── message_loc: (172,9)-(172,10) = "a" + │ │ │ │ ├── message_loc: (169,9)-(169,10) = "a" │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :-@ - │ │ │ ├── message_loc: (172,8)-(172,9) = "-" + │ │ │ ├── message_loc: (169,8)-(169,9) = "-" │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ @@ -1786,43 +1796,44 @@ │ ├── body: ∅ │ ├── locals: [:x] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (172,0)-(172,3) = "def" + │ ├── def_keyword_loc: (169,0)-(169,3) = "def" │ ├── operator_loc: ∅ │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (172,12)-(172,15) = "end" - ├── @ DefNode (location: (174,0)-(174,15)) + │ └── end_keyword_loc: (169,12)-(169,15) = "end" + ├── @ DefNode (location: (171,0)-(171,15)) │ ├── name: :f - │ ├── name_loc: (174,4)-(174,5) = "f" + │ ├── name_loc: (171,4)-(171,5) = "f" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (174,6)-(174,10)) + │ │ @ ParametersNode (location: (171,6)-(171,10)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) - │ │ │ └── @ OptionalKeywordParameterNode (location: (174,6)-(174,10)) + │ │ │ └── @ OptionalKeywordParameterNode (location: (171,6)-(171,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :x - │ │ │ ├── name_loc: (174,6)-(174,8) = "x:" + │ │ │ ├── name_loc: (171,6)-(171,8) = "x:" │ │ │ └── value: - │ │ │ @ CallNode (location: (174,8)-(174,10)) + │ │ │ @ CallNode (location: (171,8)-(171,10)) │ │ │ ├── flags: ∅ │ │ │ ├── receiver: - │ │ │ │ @ CallNode (location: (174,9)-(174,10)) + │ │ │ │ @ CallNode (location: (171,9)-(171,10)) │ │ │ │ ├── flags: variable_call, ignore_visibility │ │ │ │ ├── receiver: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :a - │ │ │ │ ├── message_loc: (174,9)-(174,10) = "a" + │ │ │ │ ├── message_loc: (171,9)-(171,10) = "a" │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+@ - │ │ │ ├── message_loc: (174,8)-(174,9) = "+" + │ │ │ ├── message_loc: (171,8)-(171,9) = "+" │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ @@ -1832,43 +1843,44 @@ │ ├── body: ∅ │ ├── locals: [:x] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (174,0)-(174,3) = "def" + │ ├── def_keyword_loc: (171,0)-(171,3) = "def" │ ├── operator_loc: ∅ │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (174,12)-(174,15) = "end" - ├── @ DefNode (location: (176,0)-(176,15)) + │ └── end_keyword_loc: (171,12)-(171,15) = "end" + ├── @ DefNode (location: (173,0)-(173,15)) │ ├── name: :f - │ ├── name_loc: (176,4)-(176,5) = "f" + │ ├── name_loc: (173,4)-(173,5) = "f" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (176,6)-(176,10)) + │ │ @ ParametersNode (location: (173,6)-(173,10)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) - │ │ │ └── @ OptionalKeywordParameterNode (location: (176,6)-(176,10)) + │ │ │ └── @ OptionalKeywordParameterNode (location: (173,6)-(173,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :x - │ │ │ ├── name_loc: (176,6)-(176,8) = "x:" + │ │ │ ├── name_loc: (173,6)-(173,8) = "x:" │ │ │ └── value: - │ │ │ @ CallNode (location: (176,8)-(176,10)) + │ │ │ @ CallNode (location: (173,8)-(173,10)) │ │ │ ├── flags: ∅ │ │ │ ├── receiver: - │ │ │ │ @ CallNode (location: (176,9)-(176,10)) + │ │ │ │ @ CallNode (location: (173,9)-(173,10)) │ │ │ │ ├── flags: variable_call, ignore_visibility │ │ │ │ ├── receiver: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :a - │ │ │ │ ├── message_loc: (176,9)-(176,10) = "a" + │ │ │ │ ├── message_loc: (173,9)-(173,10) = "a" │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :! - │ │ │ ├── message_loc: (176,8)-(176,9) = "!" + │ │ │ ├── message_loc: (173,8)-(173,9) = "!" │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ @@ -1878,107 +1890,110 @@ │ ├── body: ∅ │ ├── locals: [:x] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (176,0)-(176,3) = "def" + │ ├── def_keyword_loc: (173,0)-(173,3) = "def" │ ├── operator_loc: ∅ │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (176,12)-(176,15) = "end" - ├── @ DefNode (location: (178,0)-(178,20)) + │ └── end_keyword_loc: (173,12)-(173,15) = "end" + ├── @ DefNode (location: (175,0)-(175,20)) │ ├── name: :foo - │ ├── name_loc: (178,4)-(178,7) = "foo" + │ ├── name_loc: (175,4)-(175,7) = "foo" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (178,8)-(178,15)) + │ │ @ ParametersNode (location: (175,8)-(175,15)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) - │ │ │ └── @ OptionalKeywordParameterNode (location: (178,8)-(178,15)) + │ │ │ └── @ OptionalKeywordParameterNode (location: (175,8)-(175,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :x - │ │ │ ├── name_loc: (178,8)-(178,10) = "x:" + │ │ │ ├── name_loc: (175,8)-(175,10) = "x:" │ │ │ └── value: - │ │ │ @ StringNode (location: (178,10)-(178,15)) + │ │ │ @ StringNode (location: (175,10)-(175,15)) │ │ │ ├── flags: ∅ - │ │ │ ├── opening_loc: (178,10)-(178,12) = "%(" - │ │ │ ├── content_loc: (178,12)-(178,14) = "xx" - │ │ │ ├── closing_loc: (178,14)-(178,15) = ")" + │ │ │ ├── opening_loc: (175,10)-(175,12) = "%(" + │ │ │ ├── content_loc: (175,12)-(175,14) = "xx" + │ │ │ ├── closing_loc: (175,14)-(175,15) = ")" │ │ │ └── unescaped: "xx" │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ │ ├── body: ∅ │ ├── locals: [:x] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (178,0)-(178,3) = "def" + │ ├── def_keyword_loc: (175,0)-(175,3) = "def" │ ├── operator_loc: ∅ │ ├── lparen_loc: ∅ │ ├── rparen_loc: ∅ │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (178,17)-(178,20) = "end" - ├── @ DefNode (location: (180,0)-(182,3)) + │ └── end_keyword_loc: (175,17)-(175,20) = "end" + ├── @ DefNode (location: (177,0)-(179,3)) │ ├── name: :foo - │ ├── name_loc: (180,4)-(180,7) = "foo" + │ ├── name_loc: (177,4)-(177,7) = "foo" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (180,8)-(180,11)) + │ │ @ ParametersNode (location: (177,8)-(177,11)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: - │ │ │ @ ForwardingParameterNode (location: (180,8)-(180,11)) + │ │ │ @ ForwardingParameterNode (location: (177,8)-(177,11)) │ │ └── block: ∅ │ ├── body: - │ │ @ StatementsNode (location: (181,2)-(181,7)) + │ │ @ StatementsNode (location: (178,2)-(178,7)) │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (181,2)-(181,7)) + │ │ └── @ CallNode (location: (178,2)-(178,7)) │ │ ├── flags: ignore_visibility │ │ ├── receiver: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :bar - │ │ ├── message_loc: (181,2)-(181,5) = "bar" - │ │ ├── opening_loc: (181,5)-(181,6) = "(" + │ │ ├── message_loc: (178,2)-(178,5) = "bar" + │ │ ├── opening_loc: (178,5)-(178,6) = "(" │ │ ├── arguments: ∅ - │ │ ├── closing_loc: (181,7)-(181,8) = ")" + │ │ ├── closing_loc: (178,7)-(178,8) = ")" │ │ └── block: - │ │ @ BlockArgumentNode (location: (181,6)-(181,7)) + │ │ @ BlockArgumentNode (location: (178,6)-(178,7)) │ │ ├── expression: ∅ - │ │ └── operator_loc: (181,6)-(181,7) = "&" + │ │ └── operator_loc: (178,6)-(178,7) = "&" │ ├── locals: [:"..."] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (180,0)-(180,3) = "def" + │ ├── def_keyword_loc: (177,0)-(177,3) = "def" │ ├── operator_loc: ∅ - │ ├── lparen_loc: (180,7)-(180,8) = "(" - │ ├── rparen_loc: (180,11)-(180,12) = ")" + │ ├── lparen_loc: (177,7)-(177,8) = "(" + │ ├── rparen_loc: (177,11)-(177,12) = ")" │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (182,0)-(182,3) = "end" - ├── @ DefNode (location: (184,0)-(184,42)) + │ └── end_keyword_loc: (179,0)-(179,3) = "end" + ├── @ DefNode (location: (181,0)-(181,42)) │ ├── name: :foo - │ ├── name_loc: (184,4)-(184,7) = "foo" + │ ├── name_loc: (181,4)-(181,7) = "foo" │ ├── receiver: ∅ │ ├── parameters: - │ │ @ ParametersNode (location: (184,8)-(184,37)) + │ │ @ ParametersNode (location: (181,8)-(181,37)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) - │ │ │ └── @ OptionalParameterNode (location: (184,8)-(184,37)) + │ │ │ └── @ OptionalParameterNode (location: (181,8)-(181,37)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar - │ │ │ ├── name_loc: (184,8)-(184,11) = "bar" - │ │ │ ├── operator_loc: (184,12)-(184,13) = "=" + │ │ │ ├── name_loc: (181,8)-(181,11) = "bar" + │ │ │ ├── operator_loc: (181,12)-(181,13) = "=" │ │ │ └── value: - │ │ │ @ ParenthesesNode (location: (184,14)-(184,37)) + │ │ │ @ ParenthesesNode (location: (181,14)-(181,37)) │ │ │ ├── body: - │ │ │ │ @ StatementsNode (location: (184,15)-(184,36)) + │ │ │ │ @ StatementsNode (location: (181,15)-(181,36)) │ │ │ │ └── body: (length: 2) - │ │ │ │ ├── @ DefNode (location: (184,15)-(184,33)) + │ │ │ │ ├── @ DefNode (location: (181,15)-(181,33)) │ │ │ │ │ ├── name: :baz - │ │ │ │ │ ├── name_loc: (184,19)-(184,22) = "baz" + │ │ │ │ │ ├── name_loc: (181,19)-(181,22) = "baz" │ │ │ │ │ ├── receiver: ∅ │ │ │ │ │ ├── parameters: - │ │ │ │ │ │ @ ParametersNode (location: (184,23)-(184,26)) + │ │ │ │ │ │ @ ParametersNode (location: (181,23)-(181,26)) │ │ │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (184,23)-(184,26)) + │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (181,23)-(181,26)) + │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ └── name: :bar │ │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ │ ├── rest: ∅ @@ -1987,70 +2002,71 @@ │ │ │ │ │ │ ├── keyword_rest: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── body: - │ │ │ │ │ │ @ StatementsNode (location: (184,30)-(184,33)) + │ │ │ │ │ │ @ StatementsNode (location: (181,30)-(181,33)) │ │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ │ └── @ LocalVariableReadNode (location: (184,30)-(184,33)) + │ │ │ │ │ │ └── @ LocalVariableReadNode (location: (181,30)-(181,33)) │ │ │ │ │ │ ├── name: :bar │ │ │ │ │ │ └── depth: 0 │ │ │ │ │ ├── locals: [:bar] │ │ │ │ │ ├── locals_body_index: 1 - │ │ │ │ │ ├── def_keyword_loc: (184,15)-(184,18) = "def" + │ │ │ │ │ ├── def_keyword_loc: (181,15)-(181,18) = "def" │ │ │ │ │ ├── operator_loc: ∅ - │ │ │ │ │ ├── lparen_loc: (184,22)-(184,23) = "(" - │ │ │ │ │ ├── rparen_loc: (184,26)-(184,27) = ")" - │ │ │ │ │ ├── equal_loc: (184,28)-(184,29) = "=" + │ │ │ │ │ ├── lparen_loc: (181,22)-(181,23) = "(" + │ │ │ │ │ ├── rparen_loc: (181,26)-(181,27) = ")" + │ │ │ │ │ ├── equal_loc: (181,28)-(181,29) = "=" │ │ │ │ │ └── end_keyword_loc: ∅ - │ │ │ │ └── @ IntegerNode (location: (184,35)-(184,36)) + │ │ │ │ └── @ IntegerNode (location: (181,35)-(181,36)) │ │ │ │ └── flags: decimal - │ │ │ ├── opening_loc: (184,14)-(184,15) = "(" - │ │ │ └── closing_loc: (184,36)-(184,37) = ")" + │ │ │ ├── opening_loc: (181,14)-(181,15) = "(" + │ │ │ └── closing_loc: (181,36)-(181,37) = ")" │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ │ ├── body: - │ │ @ StatementsNode (location: (184,41)-(184,42)) + │ │ @ StatementsNode (location: (181,41)-(181,42)) │ │ └── body: (length: 1) - │ │ └── @ IntegerNode (location: (184,41)-(184,42)) + │ │ └── @ IntegerNode (location: (181,41)-(181,42)) │ │ └── flags: decimal │ ├── locals: [:bar] │ ├── locals_body_index: 1 - │ ├── def_keyword_loc: (184,0)-(184,3) = "def" + │ ├── def_keyword_loc: (181,0)-(181,3) = "def" │ ├── operator_loc: ∅ - │ ├── lparen_loc: (184,7)-(184,8) = "(" - │ ├── rparen_loc: (184,37)-(184,38) = ")" - │ ├── equal_loc: (184,39)-(184,40) = "=" + │ ├── lparen_loc: (181,7)-(181,8) = "(" + │ ├── rparen_loc: (181,37)-(181,38) = ")" + │ ├── equal_loc: (181,39)-(181,40) = "=" │ └── end_keyword_loc: ∅ - └── @ DefNode (location: (186,0)-(186,37)) + └── @ DefNode (location: (183,0)-(183,37)) ├── name: :foo - ├── name_loc: (186,21)-(186,24) = "foo" + ├── name_loc: (183,21)-(183,24) = "foo" ├── receiver: - │ @ ParenthesesNode (location: (186,4)-(186,20)) + │ @ ParenthesesNode (location: (183,4)-(183,20)) │ ├── body: - │ │ @ ClassNode (location: (186,5)-(186,19)) + │ │ @ ClassNode (location: (183,5)-(183,19)) │ │ ├── locals: [] - │ │ ├── class_keyword_loc: (186,5)-(186,10) = "class" + │ │ ├── class_keyword_loc: (183,5)-(183,10) = "class" │ │ ├── constant_path: - │ │ │ @ ConstantReadNode (location: (186,11)-(186,14)) + │ │ │ @ ConstantReadNode (location: (183,11)-(183,14)) │ │ │ └── name: :Foo │ │ ├── inheritance_operator_loc: ∅ │ │ ├── superclass: ∅ │ │ ├── body: ∅ - │ │ ├── end_keyword_loc: (186,16)-(186,19) = "end" + │ │ ├── end_keyword_loc: (183,16)-(183,19) = "end" │ │ └── name: :Foo - │ ├── opening_loc: (186,4)-(186,5) = "(" - │ └── closing_loc: (186,19)-(186,20) = ")" + │ ├── opening_loc: (183,4)-(183,5) = "(" + │ └── closing_loc: (183,19)-(183,20) = ")" ├── parameters: - │ @ ParametersNode (location: (186,25)-(186,32)) + │ @ ParametersNode (location: (183,25)-(183,32)) │ ├── requireds: (length: 0) │ ├── optionals: (length: 1) - │ │ └── @ OptionalParameterNode (location: (186,25)-(186,32)) + │ │ └── @ OptionalParameterNode (location: (183,25)-(183,32)) + │ │ ├── flags: ∅ │ │ ├── name: :bar - │ │ ├── name_loc: (186,25)-(186,28) = "bar" - │ │ ├── operator_loc: (186,29)-(186,30) = "=" + │ │ ├── name_loc: (183,25)-(183,28) = "bar" + │ │ ├── operator_loc: (183,29)-(183,30) = "=" │ │ └── value: - │ │ @ IntegerNode (location: (186,31)-(186,32)) + │ │ @ IntegerNode (location: (183,31)-(183,32)) │ │ └── flags: decimal │ ├── rest: ∅ │ ├── posts: (length: 0) @@ -2058,15 +2074,15 @@ │ ├── keyword_rest: ∅ │ └── block: ∅ ├── body: - │ @ StatementsNode (location: (186,36)-(186,37)) + │ @ StatementsNode (location: (183,36)-(183,37)) │ └── body: (length: 1) - │ └── @ IntegerNode (location: (186,36)-(186,37)) + │ └── @ IntegerNode (location: (183,36)-(183,37)) │ └── flags: decimal ├── locals: [:bar] ├── locals_body_index: 1 - ├── def_keyword_loc: (186,0)-(186,3) = "def" - ├── operator_loc: (186,20)-(186,21) = "." - ├── lparen_loc: (186,24)-(186,25) = "(" - ├── rparen_loc: (186,32)-(186,33) = ")" - ├── equal_loc: (186,34)-(186,35) = "=" + ├── def_keyword_loc: (183,0)-(183,3) = "def" + ├── operator_loc: (183,20)-(183,21) = "." + ├── lparen_loc: (183,24)-(183,25) = "(" + ├── rparen_loc: (183,32)-(183,33) = ")" + ├── equal_loc: (183,34)-(183,35) = "=" └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/non_alphanumeric_methods.txt b/test/prism/snapshots/non_alphanumeric_methods.txt index cbd024e4ec..21bec6eff3 100644 --- a/test/prism/snapshots/non_alphanumeric_methods.txt +++ b/test/prism/snapshots/non_alphanumeric_methods.txt @@ -135,6 +135,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (27,6)-(27,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (27,8)-(27,9) = "b" │ │ │ └── operator_loc: (27,6)-(27,8) = "**" @@ -170,6 +171,7 @@ │ │ @ ParametersNode (location: (33,6)-(33,7)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (33,6)-(33,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/procs.txt b/test/prism/snapshots/procs.txt index 1060fb54f4..31ae6ece5b 100644 --- a/test/prism/snapshots/procs.txt +++ b/test/prism/snapshots/procs.txt @@ -15,6 +15,7 @@ │ │ │ @ ParametersNode (location: (1,4)-(1,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -24,10 +25,13 @@ │ │ │ └── block: ∅ │ │ ├── locals: (length: 3) │ │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ └── @ BlockLocalVariableNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── opening_loc: (1,3)-(1,4) = "(" │ │ └── closing_loc: (1,14)-(1,15) = ")" @@ -138,9 +142,11 @@ │ │ │ @ ParametersNode (location: (17,3)-(17,23)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (17,3)-(17,4)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (17,6)-(17,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (17,6)-(17,7) = "b" │ │ │ │ ├── operator_loc: (17,8)-(17,9) = "=" @@ -151,14 +157,17 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 2) │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (17,13)-(17,15)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :c │ │ │ │ │ └── name_loc: (17,13)-(17,15) = "c:" │ │ │ │ └── @ RequiredKeywordParameterNode (location: (17,17)-(17,19)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :d │ │ │ │ └── name_loc: (17,17)-(17,19) = "d:" │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (17,21)-(17,23)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :e │ │ │ ├── name_loc: (17,22)-(17,23) = "e" │ │ │ └── operator_loc: (17,21)-(17,22) = "&" @@ -183,9 +192,11 @@ │ │ │ @ ParametersNode (location: (19,4)-(19,33)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (19,4)-(19,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (19,7)-(19,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (19,7)-(19,8) = "b" │ │ │ │ ├── operator_loc: (19,9)-(19,10) = "=" @@ -194,24 +205,29 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (19,14)-(19,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :c │ │ │ │ ├── name_loc: (19,15)-(19,16) = "c" │ │ │ │ └── operator_loc: (19,14)-(19,15) = "*" │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 2) │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (19,18)-(19,20)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :d │ │ │ │ │ └── name_loc: (19,18)-(19,20) = "d:" │ │ │ │ └── @ RequiredKeywordParameterNode (location: (19,22)-(19,24)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :e │ │ │ │ └── name_loc: (19,22)-(19,24) = "e:" │ │ │ ├── keyword_rest: │ │ │ │ @ KeywordRestParameterNode (location: (19,26)-(19,29)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :f │ │ │ │ ├── name_loc: (19,28)-(19,29) = "f" │ │ │ │ └── operator_loc: (19,26)-(19,28) = "**" │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (19,31)-(19,33)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :g │ │ │ ├── name_loc: (19,32)-(19,33) = "g" │ │ │ └── operator_loc: (19,31)-(19,32) = "&" @@ -236,9 +252,11 @@ │ │ │ @ ParametersNode (location: (21,4)-(21,33)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (21,4)-(21,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (21,7)-(21,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (21,7)-(21,8) = "b" │ │ │ │ ├── operator_loc: (21,9)-(21,10) = "=" @@ -247,24 +265,29 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (21,14)-(21,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :c │ │ │ │ ├── name_loc: (21,15)-(21,16) = "c" │ │ │ │ └── operator_loc: (21,14)-(21,15) = "*" │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 2) │ │ │ │ ├── @ RequiredKeywordParameterNode (location: (21,18)-(21,20)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :d │ │ │ │ │ └── name_loc: (21,18)-(21,20) = "d:" │ │ │ │ └── @ RequiredKeywordParameterNode (location: (21,22)-(21,24)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :e │ │ │ │ └── name_loc: (21,22)-(21,24) = "e:" │ │ │ ├── keyword_rest: │ │ │ │ @ KeywordRestParameterNode (location: (21,26)-(21,29)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :f │ │ │ │ ├── name_loc: (21,28)-(21,29) = "f" │ │ │ │ └── operator_loc: (21,26)-(21,28) = "**" │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (21,31)-(21,33)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :g │ │ │ ├── name_loc: (21,32)-(21,33) = "g" │ │ │ └── operator_loc: (21,31)-(21,32) = "&" @@ -289,6 +312,7 @@ │ │ │ @ ParametersNode (location: (25,4)-(25,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (25,4)-(25,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -314,6 +338,7 @@ │ │ │ @ ParametersNode (location: (25,12)-(25,13)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (25,12)-(25,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -360,8 +385,10 @@ │ │ │ └── @ MultiTargetNode (location: (27,4)-(27,10)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (27,5)-(27,6)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (27,8)-(27,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) @@ -370,6 +397,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (27,12)-(27,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (27,13)-(27,14) = "c" │ │ │ └── operator_loc: (27,12)-(27,13) = "*" diff --git a/test/prism/snapshots/repeat_parameters.txt b/test/prism/snapshots/repeat_parameters.txt new file mode 100644 index 0000000000..f680a2f1b9 --- /dev/null +++ b/test/prism/snapshots/repeat_parameters.txt @@ -0,0 +1,482 @@ +@ ProgramNode (location: (1,0)-(38,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(38,3)) + └── body: (length: 13) + ├── @ DefNode (location: (1,0)-(2,3)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,12)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_ + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_] + │ ├── locals_body_index: 2 + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + ├── @ DefNode (location: (4,0)-(5,3)) + │ ├── name: :foo + │ ├── name_loc: (4,4)-(4,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (4,8)-(4,15)) + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ RequiredParameterNode (location: (4,8)-(4,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (4,11)-(4,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ └── @ RequiredParameterNode (location: (4,14)-(4,15)) + │ │ │ ├── flags: repeated_parameter + │ │ │ └── name: :_ + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_] + │ ├── locals_body_index: 2 + │ ├── def_keyword_loc: (4,0)-(4,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (4,7)-(4,8) = "(" + │ ├── rparen_loc: (4,15)-(4,16) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (7,0)-(8,3)) + │ ├── name: :foo + │ ├── name_loc: (7,4)-(7,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (7,8)-(7,19)) + │ │ ├── requireds: (length: 4) + │ │ │ ├── @ RequiredParameterNode (location: (7,8)-(7,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (7,11)-(7,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (7,14)-(7,15)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_ + │ │ │ └── @ RequiredParameterNode (location: (7,17)-(7,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_, :_b] + │ ├── locals_body_index: 3 + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (7,7)-(7,8) = "(" + │ ├── rparen_loc: (7,19)-(7,20) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,0)-(8,3) = "end" + ├── @ DefNode (location: (10,0)-(11,3)) + │ ├── name: :foo + │ ├── name_loc: (10,4)-(10,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (10,8)-(10,23)) + │ │ ├── requireds: (length: 5) + │ │ │ ├── @ RequiredParameterNode (location: (10,8)-(10,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ RequiredParameterNode (location: (10,11)-(10,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (10,14)-(10,15)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_ + │ │ │ ├── @ RequiredParameterNode (location: (10,17)-(10,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_b + │ │ │ └── @ RequiredParameterNode (location: (10,21)-(10,23)) + │ │ │ ├── flags: repeated_parameter + │ │ │ └── name: :_b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_, :_b] + │ ├── locals_body_index: 3 + │ ├── def_keyword_loc: (10,0)-(10,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (10,7)-(10,8) = "(" + │ ├── rparen_loc: (10,23)-(10,24) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ DefNode (location: (13,0)-(14,3)) + │ ├── name: :foo + │ ├── name_loc: (13,4)-(13,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (13,8)-(13,35)) + │ │ ├── requireds: (length: 3) + │ │ │ ├── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ MultiTargetNode (location: (13,11)-(13,22)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (13,12)-(13,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (13,15)-(13,18)) + │ │ │ │ │ ├── operator_loc: (13,15)-(13,16) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (13,16)-(13,18)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :_c + │ │ │ │ ├── rights: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (13,20)-(13,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :d + │ │ │ │ ├── lparen_loc: (13,11)-(13,12) = "(" + │ │ │ │ └── rparen_loc: (13,21)-(13,22) = ")" + │ │ │ └── @ MultiTargetNode (location: (13,24)-(13,35)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,25)-(13,26)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :e + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (13,28)-(13,31)) + │ │ │ │ ├── operator_loc: (13,28)-(13,29) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (13,29)-(13,31)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_c + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (13,33)-(13,34)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :f + │ │ │ ├── lparen_loc: (13,24)-(13,25) = "(" + │ │ │ └── rparen_loc: (13,34)-(13,35) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :b, :_c, :d, :e, :f] + │ ├── locals_body_index: 6 + │ ├── def_keyword_loc: (13,0)-(13,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (13,7)-(13,8) = "(" + │ ├── rparen_loc: (13,35)-(13,36) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (14,0)-(14,3) = "end" + ├── @ DefNode (location: (16,0)-(17,3)) + │ ├── name: :foo + │ ├── name_loc: (16,4)-(16,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (16,8)-(16,20)) + │ │ ├── requireds: (length: 4) + │ │ │ ├── @ RequiredParameterNode (location: (16,8)-(16,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :_a + │ │ │ ├── @ RequiredParameterNode (location: (16,12)-(16,14)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_a + │ │ │ ├── @ RequiredParameterNode (location: (16,16)-(16,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ └── @ RequiredParameterNode (location: (16,19)-(16,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a, :b, :c] + │ ├── locals_body_index: 3 + │ ├── def_keyword_loc: (16,0)-(16,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (16,7)-(16,8) = "(" + │ ├── rparen_loc: (16,20)-(16,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (17,0)-(17,3) = "end" + ├── @ DefNode (location: (19,0)-(20,3)) + │ ├── name: :foo + │ ├── name_loc: (19,4)-(19,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (19,8)-(19,32)) + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ MultiTargetNode (location: (19,8)-(19,19)) + │ │ │ │ ├── lefts: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (19,9)-(19,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (19,12)-(19,15)) + │ │ │ │ │ ├── operator_loc: (19,12)-(19,13) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (19,13)-(19,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :_b + │ │ │ │ ├── rights: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (19,17)-(19,18)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :c + │ │ │ │ ├── lparen_loc: (19,8)-(19,9) = "(" + │ │ │ │ └── rparen_loc: (19,18)-(19,19) = ")" + │ │ │ └── @ MultiTargetNode (location: (19,21)-(19,32)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,22)-(19,23)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :d + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (19,25)-(19,28)) + │ │ │ │ ├── operator_loc: (19,25)-(19,26) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (19,26)-(19,28)) + │ │ │ │ ├── flags: repeated_parameter + │ │ │ │ └── name: :_b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (19,30)-(19,31)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :e + │ │ │ ├── lparen_loc: (19,21)-(19,22) = "(" + │ │ │ └── rparen_loc: (19,31)-(19,32) = ")" + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :_b, :c, :d, :e] + │ ├── locals_body_index: 5 + │ ├── def_keyword_loc: (19,0)-(19,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (19,7)-(19,8) = "(" + │ ├── rparen_loc: (19,32)-(19,33) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (20,0)-(20,3) = "end" + ├── @ DefNode (location: (22,0)-(23,3)) + │ ├── name: :foo + │ ├── name_loc: (22,4)-(22,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (22,8)-(22,22)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (22,8)-(22,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ ├── name_loc: (22,8)-(22,10) = "_a" + │ │ │ │ ├── operator_loc: (22,11)-(22,12) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (22,13)-(22,14)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ OptionalParameterNode (location: (22,16)-(22,22)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (22,16)-(22,18) = "_a" + │ │ │ ├── operator_loc: (22,19)-(22,20) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (22,21)-(22,22)) + │ │ │ └── flags: decimal + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── locals_body_index: 1 + │ ├── def_keyword_loc: (22,0)-(22,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (22,7)-(22,8) = "(" + │ ├── rparen_loc: (22,22)-(22,23) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ DefNode (location: (25,0)-(26,3)) + │ ├── name: :foo + │ ├── name_loc: (25,4)-(25,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (25,8)-(25,16)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ RequiredKeywordParameterNode (location: (25,8)-(25,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ └── name_loc: (25,8)-(25,11) = "_a:" + │ │ │ └── @ RequiredKeywordParameterNode (location: (25,13)-(25,16)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ └── name_loc: (25,13)-(25,16) = "_a:" + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── locals_body_index: 1 + │ ├── def_keyword_loc: (25,0)-(25,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (25,7)-(25,8) = "(" + │ ├── rparen_loc: (25,16)-(25,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (26,0)-(26,3) = "end" + ├── @ DefNode (location: (28,0)-(29,3)) + │ ├── name: :foo + │ ├── name_loc: (28,4)-(28,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (28,8)-(28,20)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 2) + │ │ │ ├── @ OptionalKeywordParameterNode (location: (28,8)-(28,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :_a + │ │ │ │ ├── name_loc: (28,8)-(28,11) = "_a:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (28,12)-(28,13)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ OptionalKeywordParameterNode (location: (28,15)-(28,20)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (28,15)-(28,18) = "_a:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (28,19)-(28,20)) + │ │ │ └── flags: decimal + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── locals_body_index: 1 + │ ├── def_keyword_loc: (28,0)-(28,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (28,7)-(28,8) = "(" + │ ├── rparen_loc: (28,20)-(28,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (29,0)-(29,3) = "end" + ├── @ DefNode (location: (31,0)-(32,3)) + │ ├── name: :foo + │ ├── name_loc: (31,4)-(31,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (31,8)-(31,16)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (31,8)-(31,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (31,12)-(31,16)) + │ │ │ ├── flags: repeated_parameter + │ │ │ ├── name: :_a + │ │ │ ├── name_loc: (31,14)-(31,16) = "_a" + │ │ │ └── operator_loc: (31,12)-(31,14) = "**" + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── locals_body_index: 1 + │ ├── def_keyword_loc: (31,0)-(31,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (31,7)-(31,8) = "(" + │ ├── rparen_loc: (31,16)-(31,17) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (32,0)-(32,3) = "end" + ├── @ DefNode (location: (34,0)-(35,3)) + │ ├── name: :foo + │ ├── name_loc: (34,4)-(34,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (34,8)-(34,15)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (34,8)-(34,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :_a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (34,12)-(34,15)) + │ │ ├── flags: repeated_parameter + │ │ ├── name: :_a + │ │ ├── name_loc: (34,13)-(34,15) = "_a" + │ │ └── operator_loc: (34,12)-(34,13) = "&" + │ ├── body: ∅ + │ ├── locals: [:_a] + │ ├── locals_body_index: 1 + │ ├── def_keyword_loc: (34,0)-(34,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (34,7)-(34,8) = "(" + │ ├── rparen_loc: (34,15)-(34,16) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (35,0)-(35,3) = "end" + └── @ DefNode (location: (37,0)-(38,3)) + ├── name: :foo + ├── name_loc: (37,4)-(37,7) = "foo" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (37,8)-(37,15)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (37,8)-(37,10)) + │ │ ├── flags: ∅ + │ │ └── name: :_a + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (37,12)-(37,15)) + │ │ ├── flags: repeated_parameter + │ │ ├── name: :_a + │ │ ├── name_loc: (37,13)-(37,15) = "_a" + │ │ └── operator_loc: (37,12)-(37,13) = "*" + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:_a] + ├── locals_body_index: 1 + ├── def_keyword_loc: (37,0)-(37,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (37,7)-(37,8) = "(" + ├── rparen_loc: (37,15)-(37,16) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (38,0)-(38,3) = "end" diff --git a/test/prism/snapshots/rescue.txt b/test/prism/snapshots/rescue.txt index 55ae2f2232..f7675ce927 100644 --- a/test/prism/snapshots/rescue.txt +++ b/test/prism/snapshots/rescue.txt @@ -170,6 +170,7 @@ │ │ │ @ ParametersNode (location: (18,8)-(18,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (18,8)-(18,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/TestRubyParserShared.txt b/test/prism/snapshots/seattlerb/TestRubyParserShared.txt index 10e71f786d..64030f3aeb 100644 --- a/test/prism/snapshots/seattlerb/TestRubyParserShared.txt +++ b/test/prism/snapshots/seattlerb/TestRubyParserShared.txt @@ -134,8 +134,10 @@ │ │ │ @ ParametersNode (location: (52,13)-(53,9)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (52,13)-(52,14)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (53,8)-(53,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -227,8 +229,10 @@ │ │ │ @ ParametersNode (location: (67,8)-(68,9)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (67,8)-(67,9)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (68,8)-(68,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/args_kw_block.txt b/test/prism/snapshots/seattlerb/args_kw_block.txt index 538a2691d6..85a7e856d7 100644 --- a/test/prism/snapshots/seattlerb/args_kw_block.txt +++ b/test/prism/snapshots/seattlerb/args_kw_block.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :a │ │ ├── name_loc: (1,6)-(1,8) = "a:" │ │ └── value: @@ -23,6 +24,7 @@ │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ ├── flags: ∅ │ ├── name: :b │ ├── name_loc: (1,13)-(1,14) = "b" │ └── operator_loc: (1,12)-(1,13) = "&" diff --git a/test/prism/snapshots/seattlerb/block_arg__bare.txt b/test/prism/snapshots/seattlerb/block_arg__bare.txt index 81d5727812..f3b6d3c11c 100644 --- a/test/prism/snapshots/seattlerb/block_arg__bare.txt +++ b/test/prism/snapshots/seattlerb/block_arg__bare.txt @@ -17,6 +17,7 @@ │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ │ ├── name: ∅ │ ├── name_loc: ∅ │ └── operator_loc: (1,6)-(1,7) = "&" diff --git a/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt b/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt index bb6b9740a6..7429ae0638 100644 --- a/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt +++ b/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt @@ -27,6 +27,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,7)-(1,8) = "b" │ │ │ └── operator_loc: (1,5)-(1,7) = "**" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt b/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt index a5b4a6ea9c..a3588b281e 100644 --- a/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt +++ b/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,18)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,8)-(1,9) = "c" │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" @@ -34,11 +36,13 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ ├── flags: ∅ │ │ ├── name: :e │ │ ├── name_loc: (1,17)-(1,18) = "e" │ │ └── operator_loc: (1,16)-(1,17) = "&" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt b/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt index b1b51ce765..41d5f0d5e0 100644 --- a/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,17)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,8)-(1,9) = "c" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -33,6 +35,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,15)-(1,17)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :d │ │ │ ├── name_loc: (1,16)-(1,17) = "d" │ │ │ └── operator_loc: (1,15)-(1,16) = "*" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt index d16f9f1a7e..baa5f22523 100644 --- a/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,22)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,8)-(1,9) = "c" │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" @@ -33,16 +35,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :d │ │ │ ├── name_loc: (1,14)-(1,15) = "d" │ │ │ └── operator_loc: (1,13)-(1,14) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :e │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ │ │ ├── name: :f │ │ ├── name_loc: (1,21)-(1,22) = "f" │ │ └── operator_loc: (1,20)-(1,21) = "&" diff --git a/test/prism/snapshots/seattlerb/block_arg_optional.txt b/test/prism/snapshots/seattlerb/block_arg_optional.txt index fd0a988dd7..a5dde7ea58 100644 --- a/test/prism/snapshots/seattlerb/block_arg_optional.txt +++ b/test/prism/snapshots/seattlerb/block_arg_optional.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,6) = "b" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/block_arg_scope.txt b/test/prism/snapshots/seattlerb/block_arg_scope.txt index 67a57a4ab8..e17de7cf31 100644 --- a/test/prism/snapshots/seattlerb/block_arg_scope.txt +++ b/test/prism/snapshots/seattlerb/block_arg_scope.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,6)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -31,6 +32,7 @@ │ │ └── block: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ │ │ └── name: :c │ ├── opening_loc: (1,4)-(1,5) = "|" │ └── closing_loc: (1,9)-(1,10) = "|" diff --git a/test/prism/snapshots/seattlerb/block_arg_scope2.txt b/test/prism/snapshots/seattlerb/block_arg_scope2.txt index e9cc9ee3d7..b71b8fffb1 100644 --- a/test/prism/snapshots/seattlerb/block_arg_scope2.txt +++ b/test/prism/snapshots/seattlerb/block_arg_scope2.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,4)-(1,5)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -31,8 +32,10 @@ │ │ └── block: ∅ │ ├── locals: (length: 2) │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ └── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ ├── flags: ∅ │ │ └── name: :d │ ├── opening_loc: (1,3)-(1,4) = "|" │ └── closing_loc: (1,11)-(1,12) = "|" diff --git a/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt index 3670be88e9..f28af4561a 100644 --- a/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt @@ -22,15 +22,18 @@ │ │ @ ParametersNode (location: (1,5)-(1,13)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,9)-(1,10) = "c" │ │ │ └── operator_loc: (1,8)-(1,9) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_args_kwargs.txt b/test/prism/snapshots/seattlerb/block_args_kwargs.txt index 91233a8f4c..16f0e55314 100644 --- a/test/prism/snapshots/seattlerb/block_args_kwargs.txt +++ b/test/prism/snapshots/seattlerb/block_args_kwargs.txt @@ -27,6 +27,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :kwargs │ │ │ ├── name_loc: (1,7)-(1,13) = "kwargs" │ │ │ └── operator_loc: (1,5)-(1,7) = "**" diff --git a/test/prism/snapshots/seattlerb/block_args_opt1.txt b/test/prism/snapshots/seattlerb/block_args_opt1.txt index 524971b783..e7e3fa3ea0 100644 --- a/test/prism/snapshots/seattlerb/block_args_opt1.txt +++ b/test/prism/snapshots/seattlerb/block_args_opt1.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" diff --git a/test/prism/snapshots/seattlerb/block_args_opt2.txt b/test/prism/snapshots/seattlerb/block_args_opt2.txt index c31456c2c7..3b1db514a0 100644 --- a/test/prism/snapshots/seattlerb/block_args_opt2.txt +++ b/test/prism/snapshots/seattlerb/block_args_opt2.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 2) │ │ │ ├── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (1,6)-(1,7) = "b" │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -30,6 +31,7 @@ │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) │ │ │ │ └── flags: decimal │ │ │ └── @ OptionalParameterNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,11)-(1,12) = "c" │ │ │ ├── operator_loc: (1,12)-(1,13) = "=" diff --git a/test/prism/snapshots/seattlerb/block_args_opt2_2.txt b/test/prism/snapshots/seattlerb/block_args_opt2_2.txt index 530d14404e..05c9e3cf8d 100644 --- a/test/prism/snapshots/seattlerb/block_args_opt2_2.txt +++ b/test/prism/snapshots/seattlerb/block_args_opt2_2.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,22)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 2) │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -32,6 +34,7 @@ │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) │ │ │ │ └── flags: decimal │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,16)-(1,17) = "c" │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" diff --git a/test/prism/snapshots/seattlerb/block_args_opt3.txt b/test/prism/snapshots/seattlerb/block_args_opt3.txt index d21aa4e535..b0f3dfef77 100644 --- a/test/prism/snapshots/seattlerb/block_args_opt3.txt +++ b/test/prism/snapshots/seattlerb/block_args_opt3.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,26)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 2) │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -32,6 +34,7 @@ │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) │ │ │ │ └── flags: decimal │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,16)-(1,17) = "c" │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" @@ -44,6 +47,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,24)-(1,26)) + │ │ ├── flags: ∅ │ │ ├── name: :d │ │ ├── name_loc: (1,25)-(1,26) = "d" │ │ └── operator_loc: (1,24)-(1,25) = "&" diff --git a/test/prism/snapshots/seattlerb/block_break.txt b/test/prism/snapshots/seattlerb/block_break.txt index beaf322ca7..063d6b5014 100644 --- a/test/prism/snapshots/seattlerb/block_break.txt +++ b/test/prism/snapshots/seattlerb/block_break.txt @@ -40,6 +40,7 @@ │ │ │ @ ParametersNode (location: (1,18)-(1,21)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,21)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :bar │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt b/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt index 0bcbe473cd..6e3cb97b72 100644 --- a/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt +++ b/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt @@ -22,6 +22,7 @@ │ │ │ @ ParametersNode (location: (1,8)-(1,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt b/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt index 47360ddd03..79c39dbec9 100644 --- a/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt @@ -74,6 +74,7 @@ │ │ @ ParametersNode (location: (1,23)-(1,24)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,23)-(1,24)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :f │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt index 4c72b78ff8..2f1f72525a 100644 --- a/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -87,6 +87,7 @@ │ │ @ ParametersNode (location: (1,25)-(1,26)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,25)-(1,26)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :g │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ 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 8b02d32e05..be0081deea 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -29,6 +29,7 @@ │ │ │ │ └── expression: ∅ │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt index 7c9783f695..b7a45492b4 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -24,6 +24,7 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) 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 d5a8d7cbac..6b72016b6f 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -24,15 +24,18 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" diff --git a/test/prism/snapshots/seattlerb/block_decomp_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_splat.txt index cc41dd84ac..91cd1fa2dd 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_splat.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_splat.txt @@ -28,6 +28,7 @@ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" diff --git a/test/prism/snapshots/seattlerb/block_kw.txt b/test/prism/snapshots/seattlerb/block_kw.txt index 344793c40d..3a73f0ec7d 100644 --- a/test/prism/snapshots/seattlerb/block_kw.txt +++ b/test/prism/snapshots/seattlerb/block_kw.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :k │ │ │ ├── name_loc: (1,8)-(1,10) = "k:" │ │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/block_kw__required.txt b/test/prism/snapshots/seattlerb/block_kw__required.txt index 0a4c5e72e9..d314cc5c70 100644 --- a/test/prism/snapshots/seattlerb/block_kw__required.txt +++ b/test/prism/snapshots/seattlerb/block_kw__required.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :k │ │ │ └── name_loc: (1,9)-(1,11) = "k:" │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt b/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt index f41cb228ae..05c6c9c323 100644 --- a/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :kw │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" │ │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt b/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt index c353854a04..a05ca0c380 100644 --- a/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :kw │ │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" │ │ │ │ └── value: @@ -36,6 +37,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "val" │ │ │ └── @ OptionalKeywordParameterNode (location: (1,16)-(1,26)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :kw2 │ │ │ ├── name_loc: (1,16)-(1,20) = "kw2:" │ │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/block_next.txt b/test/prism/snapshots/seattlerb/block_next.txt index d43e301412..5c3cc4c2a6 100644 --- a/test/prism/snapshots/seattlerb/block_next.txt +++ b/test/prism/snapshots/seattlerb/block_next.txt @@ -40,6 +40,7 @@ │ │ │ @ ParametersNode (location: (1,17)-(1,20)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,20)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :bar │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_opt_arg.txt b/test/prism/snapshots/seattlerb/block_opt_arg.txt index 9a0539458c..38f678ab82 100644 --- a/test/prism/snapshots/seattlerb/block_opt_arg.txt +++ b/test/prism/snapshots/seattlerb/block_opt_arg.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,6) = "b" │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" @@ -32,6 +33,7 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_opt_splat.txt b/test/prism/snapshots/seattlerb/block_opt_splat.txt index 9cc74fda4c..f0182c9cc1 100644 --- a/test/prism/snapshots/seattlerb/block_opt_splat.txt +++ b/test/prism/snapshots/seattlerb/block_opt_splat.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,6) = "b" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -31,6 +32,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,13)-(1,14) = "c" │ │ │ └── operator_loc: (1,12)-(1,13) = "*" diff --git a/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt index ca0b2414ea..48d8d3e4f2 100644 --- a/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt +++ b/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,6) = "b" │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" @@ -31,16 +32,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,11)-(1,12) = "c" │ │ │ └── operator_loc: (1,10)-(1,11) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ ├── flags: ∅ │ │ ├── name: :e │ │ ├── name_loc: (1,18)-(1,19) = "e" │ │ └── operator_loc: (1,17)-(1,18) = "&" diff --git a/test/prism/snapshots/seattlerb/block_optarg.txt b/test/prism/snapshots/seattlerb/block_optarg.txt index 5e63cc3636..3328ee30e3 100644 --- a/test/prism/snapshots/seattlerb/block_optarg.txt +++ b/test/prism/snapshots/seattlerb/block_optarg.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,6) = "b" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/block_paren_splat.txt b/test/prism/snapshots/seattlerb/block_paren_splat.txt index e17dc52702..5426cad0a3 100644 --- a/test/prism/snapshots/seattlerb/block_paren_splat.txt +++ b/test/prism/snapshots/seattlerb/block_paren_splat.txt @@ -24,12 +24,14 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,12)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" diff --git a/test/prism/snapshots/seattlerb/block_reg_optarg.txt b/test/prism/snapshots/seattlerb/block_reg_optarg.txt index 8a43bec7d0..47d1985200 100644 --- a/test/prism/snapshots/seattlerb/block_reg_optarg.txt +++ b/test/prism/snapshots/seattlerb/block_reg_optarg.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,8)-(1,9) = "c" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" diff --git a/test/prism/snapshots/seattlerb/block_return.txt b/test/prism/snapshots/seattlerb/block_return.txt index 32f24f3312..7d9e29036a 100644 --- a/test/prism/snapshots/seattlerb/block_return.txt +++ b/test/prism/snapshots/seattlerb/block_return.txt @@ -41,6 +41,7 @@ │ │ @ ParametersNode (location: (1,19)-(1,22)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,19)-(1,22)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/block_scope.txt b/test/prism/snapshots/seattlerb/block_scope.txt index f84212af5d..6537393872 100644 --- a/test/prism/snapshots/seattlerb/block_scope.txt +++ b/test/prism/snapshots/seattlerb/block_scope.txt @@ -21,6 +21,7 @@ │ ├── parameters: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :b │ ├── opening_loc: (1,4)-(1,5) = "|" │ └── closing_loc: (1,7)-(1,8) = "|" diff --git a/test/prism/snapshots/seattlerb/block_splat_reg.txt b/test/prism/snapshots/seattlerb/block_splat_reg.txt index 7ea8f5d05c..47d3b69463 100644 --- a/test/prism/snapshots/seattlerb/block_splat_reg.txt +++ b/test/prism/snapshots/seattlerb/block_splat_reg.txt @@ -24,11 +24,13 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,6)-(1,7) = "b" │ │ │ └── operator_loc: (1,5)-(1,6) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/bug236.txt b/test/prism/snapshots/seattlerb/bug236.txt index b5815e152e..07ec809bd1 100644 --- a/test/prism/snapshots/seattlerb/bug236.txt +++ b/test/prism/snapshots/seattlerb/bug236.txt @@ -22,6 +22,7 @@ │ │ │ @ ParametersNode (location: (1,3)-(1,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: @@ -55,6 +56,7 @@ │ │ @ ParametersNode (location: (3,3)-(3,4)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (3,3)-(3,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/bug_args__19.txt b/test/prism/snapshots/seattlerb/bug_args__19.txt index 92b1628c46..ec17de9a2e 100644 --- a/test/prism/snapshots/seattlerb/bug_args__19.txt +++ b/test/prism/snapshots/seattlerb/bug_args__19.txt @@ -24,8 +24,10 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn.txt b/test/prism/snapshots/seattlerb/bug_args_masgn.txt index b71736c49d..1ea7d0555e 100644 --- a/test/prism/snapshots/seattlerb/bug_args_masgn.txt +++ b/test/prism/snapshots/seattlerb/bug_args_masgn.txt @@ -24,14 +24,17 @@ │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,11)) │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :a │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :b │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn2.txt b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt index 1b19f520e4..947c9cdfd3 100644 --- a/test/prism/snapshots/seattlerb/bug_args_masgn2.txt +++ b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt @@ -26,20 +26,24 @@ │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) │ │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ └── name: :b │ │ │ │ │ │ ├── rest: ∅ │ │ │ │ │ │ ├── rights: (length: 0) │ │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" │ │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :c │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" │ │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ 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 d5a2c6264f..615e6445b7 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 @@ -26,14 +26,17 @@ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ └── name: :k │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :v │ │ │ │ │ ├── rest: ∅ │ │ │ │ │ ├── rights: (length: 0) │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :i │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) diff --git a/test/prism/snapshots/seattlerb/bug_masgn_right.txt b/test/prism/snapshots/seattlerb/bug_masgn_right.txt index d68ac5ecfc..d84a59d97f 100644 --- a/test/prism/snapshots/seattlerb/bug_masgn_right.txt +++ b/test/prism/snapshots/seattlerb/bug_masgn_right.txt @@ -22,12 +22,15 @@ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :b │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) diff --git a/test/prism/snapshots/seattlerb/case_in.txt b/test/prism/snapshots/seattlerb/case_in.txt index 26a3642dc7..94ff42b8b2 100644 --- a/test/prism/snapshots/seattlerb/case_in.txt +++ b/test/prism/snapshots/seattlerb/case_in.txt @@ -557,6 +557,7 @@ │ │ │ │ │ │ │ @ ParametersNode (location: (70,7)-(70,8)) │ │ │ │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (70,7)-(70,8)) + │ │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ │ └── name: :b │ │ │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt b/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt index 6adedb2395..ecc7ad04a4 100644 --- a/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt +++ b/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt @@ -11,15 +11,18 @@ │ @ ParametersNode (location: (1,9)-(1,24)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,9)-(1,15)) + │ │ ├── flags: ∅ │ │ └── name: :interp │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,17)-(1,18)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,17)-(1,18) = "*" │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,20)-(1,24)) + │ │ ├── flags: ∅ │ │ └── name: :args │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt b/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt index 4124819bb0..46c0e91ade 100644 --- a/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt +++ b/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt @@ -11,6 +11,7 @@ │ @ ParametersNode (location: (1,6)-(1,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :x │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_args_forward_args.txt b/test/prism/snapshots/seattlerb/defn_args_forward_args.txt index 5f718c1546..76d0fbe71c 100644 --- a/test/prism/snapshots/seattlerb/defn_args_forward_args.txt +++ b/test/prism/snapshots/seattlerb/defn_args_forward_args.txt @@ -11,10 +11,13 @@ │ @ ParametersNode (location: (1,6)-(1,18)) │ ├── requireds: (length: 3) │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :y │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ ├── flags: ∅ │ │ └── name: :z │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_env.txt b/test/prism/snapshots/seattlerb/defn_kwarg_env.txt index 933af33cda..c0abf7f99a 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_env.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_env.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,9)-(1,18)) + │ │ ├── flags: ∅ │ │ ├── name: :testing │ │ ├── name_loc: (1,11)-(1,18) = "testing" │ │ └── operator_loc: (1,9)-(1,11) = "**" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt index 18ead9e624..4bad9a69d9 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt @@ -11,18 +11,21 @@ │ @ ParametersNode (location: (1,6)-(1,19)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 0) │ ├── rest: ∅ │ ├── posts: (length: 0) │ ├── keywords: (length: 2) │ │ ├── @ OptionalKeywordParameterNode (location: (1,9)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,9)-(1,11) = "b:" │ │ │ └── value: │ │ │ @ IntegerNode (location: (1,12)-(1,13)) │ │ │ └── flags: decimal │ │ └── @ OptionalKeywordParameterNode (location: (1,15)-(1,19)) + │ │ ├── flags: ∅ │ │ ├── name: :c │ │ ├── name_loc: (1,15)-(1,17) = "c:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt index a711c39305..8aafbb0e48 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,6)-(1,8) = "b:" │ │ └── value: @@ -22,6 +23,7 @@ │ │ └── flags: decimal │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,12)-(1,15)) + │ │ ├── flags: ∅ │ │ ├── name: :c │ │ ├── name_loc: (1,14)-(1,15) = "c" │ │ └── operator_loc: (1,12)-(1,14) = "**" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt index f16cf144ad..897a36bc6a 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,6)-(1,8) = "b:" │ │ └── value: @@ -22,6 +23,7 @@ │ │ └── flags: decimal │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,12)-(1,14) = "**" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt b/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt index ad8d189fd1..93bdb42054 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ │ │ ├── name: :kw │ │ ├── name_loc: (1,8)-(1,11) = "kw:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt b/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt index 9899f4360d..df04231ea4 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :a │ │ ├── name_loc: (1,6)-(1,8) = "a:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_val.txt b/test/prism/snapshots/seattlerb/defn_kwarg_val.txt index beca85c996..61c3dd29bd 100644 --- a/test/prism/snapshots/seattlerb/defn_kwarg_val.txt +++ b/test/prism/snapshots/seattlerb/defn_kwarg_val.txt @@ -11,12 +11,14 @@ │ @ ParametersNode (location: (1,6)-(1,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 0) │ ├── rest: ∅ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,9)-(1,11) = "b:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/defn_oneliner.txt b/test/prism/snapshots/seattlerb/defn_oneliner.txt index 38191d0f5a..d100d10eab 100644 --- a/test/prism/snapshots/seattlerb/defn_oneliner.txt +++ b/test/prism/snapshots/seattlerb/defn_oneliner.txt @@ -11,6 +11,7 @@ │ @ ParametersNode (location: (1,9)-(1,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ │ │ └── name: :cmd │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt index 7252adaa93..31418f1116 100644 --- a/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt +++ b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (2,9)-(2,10)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (2,9)-(2,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :o │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt index ebabc02c97..bb23f56c70 100644 --- a/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt +++ b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt @@ -11,6 +11,7 @@ │ │ @ ParametersNode (location: (1,9)-(1,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :cmd │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -70,6 +71,7 @@ │ │ @ ParametersNode (location: (8,9)-(8,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (8,9)-(8,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :cmd │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -117,6 +119,7 @@ │ @ ParametersNode (location: (13,9)-(13,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (13,9)-(13,12)) + │ │ ├── flags: ∅ │ │ └── name: :cmd │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt b/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt index fae68d5342..05a4cec869 100644 --- a/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt +++ b/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt @@ -12,6 +12,7 @@ │ ├── requireds: (length: 0) │ ├── optionals: (length: 1) │ │ └── @ OptionalParameterNode (location: (1,6)-(1,17)) + │ │ ├── flags: ∅ │ │ ├── name: :arg │ │ ├── name_loc: (1,6)-(1,9) = "arg" │ │ ├── operator_loc: (1,10)-(1,11) = "=" diff --git a/test/prism/snapshots/seattlerb/defn_opt_reg.txt b/test/prism/snapshots/seattlerb/defn_opt_reg.txt index aeff12d658..34b1faafa6 100644 --- a/test/prism/snapshots/seattlerb/defn_opt_reg.txt +++ b/test/prism/snapshots/seattlerb/defn_opt_reg.txt @@ -12,6 +12,7 @@ │ ├── requireds: (length: 0) │ ├── optionals: (length: 1) │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ ├── flags: ∅ │ │ ├── name: :a │ │ ├── name_loc: (1,6)-(1,7) = "a" │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -20,6 +21,7 @@ │ ├── rest: ∅ │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ ├── flags: ∅ │ │ └── name: :b │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt b/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt index 7ec94cf670..7cd554222e 100644 --- a/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt @@ -12,6 +12,7 @@ │ ├── requireds: (length: 0) │ ├── optionals: (length: 1) │ │ └── @ OptionalParameterNode (location: (1,7)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :a │ │ ├── name_loc: (1,7)-(1,8) = "a" │ │ ├── operator_loc: (1,9)-(1,10) = "=" @@ -20,11 +21,13 @@ │ │ └── flags: decimal │ ├── rest: │ │ @ RestParameterNode (location: (1,14)-(1,16)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,15)-(1,16) = "b" │ │ └── operator_loc: (1,14)-(1,15) = "*" │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ ├── flags: ∅ │ │ └── name: :c │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_powarg.txt b/test/prism/snapshots/seattlerb/defn_powarg.txt index 1b0fbe656c..5e756ca342 100644 --- a/test/prism/snapshots/seattlerb/defn_powarg.txt +++ b/test/prism/snapshots/seattlerb/defn_powarg.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,6)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :opts │ │ ├── name_loc: (1,8)-(1,12) = "opts" │ │ └── operator_loc: (1,6)-(1,8) = "**" diff --git a/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt b/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt index 6ef9635fb6..2a5e151bc2 100644 --- a/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt +++ b/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt @@ -11,9 +11,11 @@ │ @ ParametersNode (location: (1,6)-(1,18)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 1) │ │ └── @ OptionalParameterNode (location: (1,9)-(1,15)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,9)-(1,10) = "b" │ │ ├── operator_loc: (1,11)-(1,12) = "=" @@ -27,6 +29,7 @@ │ ├── rest: ∅ │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ ├── flags: ∅ │ │ └── name: :d │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_splat_arg.txt b/test/prism/snapshots/seattlerb/defn_splat_arg.txt index 453673f753..6533258fe6 100644 --- a/test/prism/snapshots/seattlerb/defn_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/defn_splat_arg.txt @@ -13,11 +13,13 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,6)-(1,7) = "*" │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_kwarg.txt b/test/prism/snapshots/seattlerb/defs_kwarg.txt index 9c42a36282..f96c6264a0 100644 --- a/test/prism/snapshots/seattlerb/defs_kwarg.txt +++ b/test/prism/snapshots/seattlerb/defs_kwarg.txt @@ -16,6 +16,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,11)-(1,15)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,11)-(1,13) = "b:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/defs_oneliner.txt b/test/prism/snapshots/seattlerb/defs_oneliner.txt index e1ae681bb3..dbbb5e172b 100644 --- a/test/prism/snapshots/seattlerb/defs_oneliner.txt +++ b/test/prism/snapshots/seattlerb/defs_oneliner.txt @@ -12,6 +12,7 @@ │ @ ParametersNode (location: (1,14)-(1,17)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ ├── flags: ∅ │ │ └── name: :cmd │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt index ffbb6befd8..868efde81f 100644 --- a/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt +++ b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt @@ -23,6 +23,7 @@ │ │ @ ParametersNode (location: (2,14)-(2,15)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (2,14)-(2,15)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :o │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt index 69f7b9986d..80d0332823 100644 --- a/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt +++ b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt @@ -12,6 +12,7 @@ │ │ @ ParametersNode (location: (1,14)-(1,17)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :cmd │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -72,6 +73,7 @@ │ │ @ ParametersNode (location: (8,14)-(8,17)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (8,14)-(8,17)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :cmd │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -120,6 +122,7 @@ │ @ ParametersNode (location: (13,14)-(13,17)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (13,14)-(13,17)) + │ │ ├── flags: ∅ │ │ └── name: :cmd │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult3_.txt b/test/prism/snapshots/seattlerb/difficult3_.txt index 9b6052f032..4d5051d564 100644 --- a/test/prism/snapshots/seattlerb/difficult3_.txt +++ b/test/prism/snapshots/seattlerb/difficult3_.txt @@ -22,16 +22,19 @@ │ │ @ ParametersNode (location: (1,5)-(1,15)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" diff --git a/test/prism/snapshots/seattlerb/difficult3_2.txt b/test/prism/snapshots/seattlerb/difficult3_2.txt index 9daf24bba0..842c3e86a1 100644 --- a/test/prism/snapshots/seattlerb/difficult3_2.txt +++ b/test/prism/snapshots/seattlerb/difficult3_2.txt @@ -24,11 +24,13 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,6)-(1,7) = "a" │ │ │ └── operator_loc: (1,5)-(1,6) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult3_3.txt b/test/prism/snapshots/seattlerb/difficult3_3.txt index b8a80f5453..bfc3a0329b 100644 --- a/test/prism/snapshots/seattlerb/difficult3_3.txt +++ b/test/prism/snapshots/seattlerb/difficult3_3.txt @@ -24,16 +24,19 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,6)-(1,7) = "a" │ │ │ └── operator_loc: (1,5)-(1,6) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ │ │ ├── name: :c │ │ ├── name_loc: (1,13)-(1,14) = "c" │ │ └── operator_loc: (1,12)-(1,13) = "&" diff --git a/test/prism/snapshots/seattlerb/difficult3__10.txt b/test/prism/snapshots/seattlerb/difficult3__10.txt index 4242d24d06..a7dc59371c 100644 --- a/test/prism/snapshots/seattlerb/difficult3__10.txt +++ b/test/prism/snapshots/seattlerb/difficult3__10.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,15)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) │ │ │ ├── lefts: (length: 0) @@ -30,9 +31,11 @@ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" diff --git a/test/prism/snapshots/seattlerb/difficult3__11.txt b/test/prism/snapshots/seattlerb/difficult3__11.txt index 6cc067406a..5b393885a3 100644 --- a/test/prism/snapshots/seattlerb/difficult3__11.txt +++ b/test/prism/snapshots/seattlerb/difficult3__11.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,11)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,11)) │ │ │ ├── lefts: (length: 0) diff --git a/test/prism/snapshots/seattlerb/difficult3__12.txt b/test/prism/snapshots/seattlerb/difficult3__12.txt index b4854b1be1..71be50a515 100644 --- a/test/prism/snapshots/seattlerb/difficult3__12.txt +++ b/test/prism/snapshots/seattlerb/difficult3__12.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) │ │ │ ├── lefts: (length: 0) @@ -31,6 +32,7 @@ │ │ │ │ └── expression: ∅ │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" diff --git a/test/prism/snapshots/seattlerb/difficult3__6.txt b/test/prism/snapshots/seattlerb/difficult3__6.txt index c6f7aa442f..77d14c992d 100644 --- a/test/prism/snapshots/seattlerb/difficult3__6.txt +++ b/test/prism/snapshots/seattlerb/difficult3__6.txt @@ -22,19 +22,23 @@ │ │ @ ParametersNode (location: (1,5)-(1,18)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :d │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" │ │ │ └── rparen_loc: (1,17)-(1,18) = ")" diff --git a/test/prism/snapshots/seattlerb/difficult3__7.txt b/test/prism/snapshots/seattlerb/difficult3__7.txt index 6ca5f2f586..c21a92d5ec 100644 --- a/test/prism/snapshots/seattlerb/difficult3__7.txt +++ b/test/prism/snapshots/seattlerb/difficult3__7.txt @@ -22,10 +22,12 @@ │ │ @ ParametersNode (location: (1,5)-(1,14)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) diff --git a/test/prism/snapshots/seattlerb/difficult3__8.txt b/test/prism/snapshots/seattlerb/difficult3__8.txt index caf9e7248d..0c437bddc1 100644 --- a/test/prism/snapshots/seattlerb/difficult3__8.txt +++ b/test/prism/snapshots/seattlerb/difficult3__8.txt @@ -22,10 +22,12 @@ │ │ @ ParametersNode (location: (1,5)-(1,17)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,17)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) @@ -33,6 +35,7 @@ │ │ │ │ └── expression: ∅ │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" │ │ │ └── rparen_loc: (1,16)-(1,17) = ")" diff --git a/test/prism/snapshots/seattlerb/difficult3__9.txt b/test/prism/snapshots/seattlerb/difficult3__9.txt index 98e1771a77..eec21b775c 100644 --- a/test/prism/snapshots/seattlerb/difficult3__9.txt +++ b/test/prism/snapshots/seattlerb/difficult3__9.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,12)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,12)) │ │ │ ├── lefts: (length: 0) @@ -30,6 +31,7 @@ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" diff --git a/test/prism/snapshots/seattlerb/difficult6_.txt b/test/prism/snapshots/seattlerb/difficult6_.txt index 12ada8521d..70cd8b29fc 100644 --- a/test/prism/snapshots/seattlerb/difficult6_.txt +++ b/test/prism/snapshots/seattlerb/difficult6_.txt @@ -15,9 +15,11 @@ │ │ @ ParametersNode (location: (1,3)-(1,11)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,6)-(1,7) = "b" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/seattlerb/do_bug.txt b/test/prism/snapshots/seattlerb/do_bug.txt index 143dd53a3b..a520f5ba20 100644 --- a/test/prism/snapshots/seattlerb/do_bug.txt +++ b/test/prism/snapshots/seattlerb/do_bug.txt @@ -47,6 +47,7 @@ │ │ @ ParametersNode (location: (2,8)-(2,9)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (2,8)-(2,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/f_kw.txt b/test/prism/snapshots/seattlerb/f_kw.txt index 3f4d6d6981..f1aaa471f0 100644 --- a/test/prism/snapshots/seattlerb/f_kw.txt +++ b/test/prism/snapshots/seattlerb/f_kw.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :k │ │ ├── name_loc: (1,6)-(1,8) = "k:" │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/f_kw__required.txt b/test/prism/snapshots/seattlerb/f_kw__required.txt index 61fe5edbae..6f64c71ae4 100644 --- a/test/prism/snapshots/seattlerb/f_kw__required.txt +++ b/test/prism/snapshots/seattlerb/f_kw__required.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ ├── flags: ∅ │ │ ├── name: :k │ │ └── name_loc: (1,6)-(1,8) = "k:" │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_1.txt b/test/prism/snapshots/seattlerb/iter_args_1.txt index efc52b5dfc..46775a253d 100644 --- a/test/prism/snapshots/seattlerb/iter_args_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_1.txt @@ -22,8 +22,10 @@ │ │ @ ParametersNode (location: (1,5)-(1,8)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_10_1.txt b/test/prism/snapshots/seattlerb/iter_args_10_1.txt index dae3d474ef..1f607cd2d3 100644 --- a/test/prism/snapshots/seattlerb/iter_args_10_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_10_1.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,18)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -33,6 +35,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,17)-(1,18) = "c" │ │ │ └── operator_loc: (1,16)-(1,17) = "*" diff --git a/test/prism/snapshots/seattlerb/iter_args_10_2.txt b/test/prism/snapshots/seattlerb/iter_args_10_2.txt index 062fec6aef..d15486a375 100644 --- a/test/prism/snapshots/seattlerb/iter_args_10_2.txt +++ b/test/prism/snapshots/seattlerb/iter_args_10_2.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,22)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -33,6 +35,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,17)-(1,18) = "c" │ │ │ └── operator_loc: (1,16)-(1,17) = "*" @@ -41,6 +44,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ │ │ ├── name: :d │ │ ├── name_loc: (1,21)-(1,22) = "d" │ │ └── operator_loc: (1,20)-(1,21) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_args_11_1.txt b/test/prism/snapshots/seattlerb/iter_args_11_1.txt index 16c9539fcb..972a0f1c90 100644 --- a/test/prism/snapshots/seattlerb/iter_args_11_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_11_1.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,21)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -33,11 +35,13 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,17)-(1,18) = "c" │ │ │ └── operator_loc: (1,16)-(1,17) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_11_2.txt b/test/prism/snapshots/seattlerb/iter_args_11_2.txt index ca74c5bca7..66b82cb507 100644 --- a/test/prism/snapshots/seattlerb/iter_args_11_2.txt +++ b/test/prism/snapshots/seattlerb/iter_args_11_2.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,25)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -33,16 +35,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,17)-(1,18) = "c" │ │ │ └── operator_loc: (1,16)-(1,17) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,23)-(1,25)) + │ │ ├── flags: ∅ │ │ ├── name: :e │ │ ├── name_loc: (1,24)-(1,25) = "e" │ │ └── operator_loc: (1,23)-(1,24) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_args_2__19.txt b/test/prism/snapshots/seattlerb/iter_args_2__19.txt index 788c0ba50f..3d7d251e3b 100644 --- a/test/prism/snapshots/seattlerb/iter_args_2__19.txt +++ b/test/prism/snapshots/seattlerb/iter_args_2__19.txt @@ -24,8 +24,10 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) diff --git a/test/prism/snapshots/seattlerb/iter_args_3.txt b/test/prism/snapshots/seattlerb/iter_args_3.txt index 6f7ce2b5c1..6cd964d27b 100644 --- a/test/prism/snapshots/seattlerb/iter_args_3.txt +++ b/test/prism/snapshots/seattlerb/iter_args_3.txt @@ -22,18 +22,22 @@ │ │ @ ParametersNode (location: (1,5)-(1,17)) │ │ ├── requireds: (length: 3) │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── @ MultiTargetNode (location: (1,8)-(1,14)) │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :b │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :c │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :d │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_4.txt b/test/prism/snapshots/seattlerb/iter_args_4.txt index 516273f02f..d2622965d6 100644 --- a/test/prism/snapshots/seattlerb/iter_args_4.txt +++ b/test/prism/snapshots/seattlerb/iter_args_4.txt @@ -22,15 +22,18 @@ │ │ @ ParametersNode (location: (1,5)-(1,13)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,9)-(1,10) = "b" │ │ │ └── operator_loc: (1,8)-(1,9) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_5.txt b/test/prism/snapshots/seattlerb/iter_args_5.txt index efd1cfbcb8..4f121beccd 100644 --- a/test/prism/snapshots/seattlerb/iter_args_5.txt +++ b/test/prism/snapshots/seattlerb/iter_args_5.txt @@ -22,6 +22,7 @@ │ │ @ ParametersNode (location: (1,5)-(1,10)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -30,6 +31,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,9)-(1,10) = "b" │ │ └── operator_loc: (1,8)-(1,9) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_args_6.txt b/test/prism/snapshots/seattlerb/iter_args_6.txt index d0f707012d..4e0c8e1150 100644 --- a/test/prism/snapshots/seattlerb/iter_args_6.txt +++ b/test/prism/snapshots/seattlerb/iter_args_6.txt @@ -22,9 +22,11 @@ │ │ @ ParametersNode (location: (1,5)-(1,15)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,8)-(1,9) = "b" │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" @@ -34,6 +36,7 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_7_1.txt b/test/prism/snapshots/seattlerb/iter_args_7_1.txt index 9b71f4aecb..5e61efdaae 100644 --- a/test/prism/snapshots/seattlerb/iter_args_7_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_7_1.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -31,6 +32,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,14)-(1,15) = "b" │ │ │ └── operator_loc: (1,13)-(1,14) = "*" diff --git a/test/prism/snapshots/seattlerb/iter_args_7_2.txt b/test/prism/snapshots/seattlerb/iter_args_7_2.txt index bc9e23496e..e1fa58d728 100644 --- a/test/prism/snapshots/seattlerb/iter_args_7_2.txt +++ b/test/prism/snapshots/seattlerb/iter_args_7_2.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -31,6 +32,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,14)-(1,15) = "b" │ │ │ └── operator_loc: (1,13)-(1,14) = "*" @@ -39,6 +41,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ ├── flags: ∅ │ │ ├── name: :c │ │ ├── name_loc: (1,18)-(1,19) = "c" │ │ └── operator_loc: (1,17)-(1,18) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_args_8_1.txt b/test/prism/snapshots/seattlerb/iter_args_8_1.txt index 488ee837f4..46e1ab5f6b 100644 --- a/test/prism/snapshots/seattlerb/iter_args_8_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_8_1.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -31,11 +32,13 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,14)-(1,15) = "b" │ │ │ └── operator_loc: (1,13)-(1,14) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_8_2.txt b/test/prism/snapshots/seattlerb/iter_args_8_2.txt index cd4fcc59f6..ecce85c3bf 100644 --- a/test/prism/snapshots/seattlerb/iter_args_8_2.txt +++ b/test/prism/snapshots/seattlerb/iter_args_8_2.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -31,16 +32,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,14)-(1,15) = "b" │ │ │ └── operator_loc: (1,13)-(1,14) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ │ │ ├── name: :d │ │ ├── name_loc: (1,21)-(1,22) = "d" │ │ └── operator_loc: (1,20)-(1,21) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_args_9_1.txt b/test/prism/snapshots/seattlerb/iter_args_9_1.txt index 40ffcec029..cb617efc7c 100644 --- a/test/prism/snapshots/seattlerb/iter_args_9_1.txt +++ b/test/prism/snapshots/seattlerb/iter_args_9_1.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -32,6 +33,7 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/iter_args_9_2.txt b/test/prism/snapshots/seattlerb/iter_args_9_2.txt index 18cdc620ce..1488be20e2 100644 --- a/test/prism/snapshots/seattlerb/iter_args_9_2.txt +++ b/test/prism/snapshots/seattlerb/iter_args_9_2.txt @@ -23,6 +23,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -32,11 +33,13 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ ├── flags: ∅ │ │ ├── name: :c │ │ ├── name_loc: (1,17)-(1,18) = "c" │ │ └── operator_loc: (1,16)-(1,17) = "&" diff --git a/test/prism/snapshots/seattlerb/iter_kwarg.txt b/test/prism/snapshots/seattlerb/iter_kwarg.txt index b7655eec2c..fc91eaa703 100644 --- a/test/prism/snapshots/seattlerb/iter_kwarg.txt +++ b/test/prism/snapshots/seattlerb/iter_kwarg.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" │ │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt b/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt index 0c4b3920c1..5fcda7645e 100644 --- a/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt +++ b/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt @@ -26,6 +26,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" │ │ │ └── value: @@ -33,6 +34,7 @@ │ │ │ └── flags: decimal │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,13)-(1,14) = "c" │ │ │ └── operator_loc: (1,11)-(1,13) = "**" diff --git a/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt b/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt index 475e8d9efd..1688e88c78 100644 --- a/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt +++ b/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt @@ -22,8 +22,10 @@ │ │ @ ParametersNode (location: (1,6)-(1,10)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :y │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt b/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt index 4df2cea7cd..cd61a9897e 100644 --- a/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt +++ b/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt @@ -11,6 +11,7 @@ │ @ ParametersNode (location: (1,6)-(1,7)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :y │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt index 8a0a1c752a..aebf2cf933 100644 --- a/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt +++ b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt @@ -11,6 +11,7 @@ │ @ ParametersNode (location: (1,6)-(1,7)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt b/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt index 9edb2c6202..cd721a3fea 100644 --- a/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt @@ -35,8 +35,10 @@ │ │ @ ParametersNode (location: (1,8)-(1,12)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :y │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt b/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt index d92e8a18dc..2fba775aac 100644 --- a/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt @@ -35,8 +35,10 @@ │ │ @ ParametersNode (location: (1,9)-(1,13)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :x │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :y │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/pipe_semicolon.txt b/test/prism/snapshots/seattlerb/pipe_semicolon.txt index 1d83dc50cf..cf26a2951e 100644 --- a/test/prism/snapshots/seattlerb/pipe_semicolon.txt +++ b/test/prism/snapshots/seattlerb/pipe_semicolon.txt @@ -31,6 +31,7 @@ │ ├── parameters: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (1,11)-(1,12)) + │ │ ├── flags: ∅ │ │ └── name: :c │ ├── opening_loc: (1,7)-(1,8) = "|" │ └── closing_loc: (1,13)-(1,14) = "|" diff --git a/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt b/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt index fe2ce0bc7e..922817c191 100644 --- a/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt +++ b/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt @@ -15,9 +15,11 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 2) │ │ ├── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ └── name_loc: (1,6)-(1,8) = "a:" │ │ └── @ RequiredKeywordParameterNode (location: (1,10)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ └── name_loc: (1,10)-(1,12) = "b:" │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt b/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt index a2c67e609c..dddd22eb23 100644 --- a/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt +++ b/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt @@ -15,6 +15,7 @@ │ │ @ ParametersNode (location: (1,2)-(1,3)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,2)-(1,3)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt index 1cd4580bc5..d0d5885432 100644 --- a/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt +++ b/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -15,9 +15,11 @@ │ │ @ ParametersNode (location: (1,3)-(1,20)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :c │ │ │ ├── name_loc: (1,6)-(1,7) = "c" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -26,16 +28,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :d │ │ │ ├── name_loc: (1,12)-(1,13) = "d" │ │ │ └── operator_loc: (1,11)-(1,12) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :e │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,18)-(1,20)) + │ │ ├── flags: ∅ │ │ ├── name: :f │ │ ├── name_loc: (1,19)-(1,20) = "f" │ │ └── operator_loc: (1,18)-(1,19) = "&" diff --git a/test/prism/snapshots/seattlerb/stabby_block_kw.txt b/test/prism/snapshots/seattlerb/stabby_block_kw.txt index b9a2151a76..342145bb63 100644 --- a/test/prism/snapshots/seattlerb/stabby_block_kw.txt +++ b/test/prism/snapshots/seattlerb/stabby_block_kw.txt @@ -19,6 +19,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (1,4)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :k │ │ │ ├── name_loc: (1,4)-(1,6) = "k:" │ │ │ └── value: diff --git a/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt b/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt index 5d0ac1e5c0..ed34442272 100644 --- a/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt +++ b/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt @@ -19,6 +19,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :k │ │ │ └── name_loc: (1,4)-(1,6) = "k:" │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_proc_scope.txt b/test/prism/snapshots/seattlerb/stabby_proc_scope.txt index 23ab524fad..38d9a455cb 100644 --- a/test/prism/snapshots/seattlerb/stabby_proc_scope.txt +++ b/test/prism/snapshots/seattlerb/stabby_proc_scope.txt @@ -15,6 +15,7 @@ │ │ @ ParametersNode (location: (1,3)-(1,4)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -24,6 +25,7 @@ │ │ └── block: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ └── name: :b │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,7)-(1,8) = ")" diff --git a/test/prism/snapshots/unparser/corpus/literal/block.txt b/test/prism/snapshots/unparser/corpus/literal/block.txt index 8c8d9ac508..17cde39e64 100644 --- a/test/prism/snapshots/unparser/corpus/literal/block.txt +++ b/test/prism/snapshots/unparser/corpus/literal/block.txt @@ -39,6 +39,7 @@ │ │ │ @ ParametersNode (location: (3,7)-(3,8)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (3,7)-(3,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -71,6 +72,7 @@ │ │ │ @ ParametersNode (location: (5,7)-(5,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (5,7)-(5,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: @@ -104,6 +106,7 @@ │ │ │ @ ParametersNode (location: (7,7)-(7,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (7,7)-(7,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: @@ -114,6 +117,7 @@ │ │ │ └── block: ∅ │ │ ├── locals: (length: 1) │ │ │ └── @ BlockLocalVariableNode (location: (7,11)-(7,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── opening_loc: (7,6)-(7,7) = "|" │ │ └── closing_loc: (7,12)-(7,13) = "|" @@ -139,8 +143,10 @@ │ │ │ @ ParametersNode (location: (9,7)-(9,11)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (9,7)-(9,8)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (9,10)-(9,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -198,10 +204,12 @@ │ │ │ @ ParametersNode (location: (14,7)-(14,12)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (14,7)-(14,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (14,10)-(14,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :b │ │ │ │ ├── name_loc: (14,11)-(14,12) = "b" │ │ │ │ └── operator_loc: (14,10)-(14,11) = "*" @@ -237,10 +245,12 @@ │ │ │ @ ParametersNode (location: (17,7)-(17,11)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (17,7)-(17,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (17,10)-(17,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (17,10)-(17,11) = "*" @@ -317,14 +327,17 @@ │ │ │ │ ├── @ MultiTargetNode (location: (23,11)-(23,17)) │ │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (23,12)-(23,13)) + │ │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ │ └── name: :a │ │ │ │ │ │ └── @ RequiredParameterNode (location: (23,15)-(23,16)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :b │ │ │ │ │ ├── rest: ∅ │ │ │ │ │ ├── rights: (length: 0) │ │ │ │ │ ├── lparen_loc: (23,11)-(23,12) = "(" │ │ │ │ │ └── rparen_loc: (23,16)-(23,17) = ")" │ │ │ │ └── @ RequiredParameterNode (location: (23,19)-(23,20)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -381,6 +394,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (26,11)-(26,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (26,12)-(26,13) = "a" │ │ │ │ └── operator_loc: (26,11)-(26,12) = "*" @@ -390,6 +404,7 @@ │ │ │ └── block: ∅ │ │ ├── locals: (length: 1) │ │ │ └── @ BlockLocalVariableNode (location: (26,15)-(26,16)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── opening_loc: (26,10)-(26,11) = "|" │ │ └── closing_loc: (26,16)-(26,17) = "|" @@ -425,6 +440,7 @@ │ │ │ @ ParametersNode (location: (28,11)-(28,12)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (28,11)-(28,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -434,6 +450,7 @@ │ │ │ └── block: ∅ │ │ ├── locals: (length: 1) │ │ │ └── @ BlockLocalVariableNode (location: (28,14)-(28,15)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── opening_loc: (28,10)-(28,11) = "|" │ │ └── closing_loc: (28,15)-(28,16) = "|" @@ -468,8 +485,10 @@ │ │ ├── parameters: ∅ │ │ ├── locals: (length: 2) │ │ │ ├── @ BlockLocalVariableNode (location: (30,13)-(30,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ BlockLocalVariableNode (location: (30,16)-(30,17)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── opening_loc: (30,10)-(30,11) = "|" │ │ └── closing_loc: (30,17)-(30,18) = "|" @@ -507,6 +526,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (32,11)-(32,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (32,11)-(32,12) = "*" @@ -691,6 +711,7 @@ │ │ │ │ └── @ MultiTargetNode (location: (41,11)-(41,19)) │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (41,12)-(41,13)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :a │ │ │ │ │ └── @ MultiTargetNode (location: (41,15)-(41,18)) │ │ │ │ │ ├── lefts: (length: 0) @@ -760,8 +781,10 @@ │ │ │ │ └── @ MultiTargetNode (location: (44,11)-(44,17)) │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (44,12)-(44,13)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :a │ │ │ │ │ └── @ RequiredParameterNode (location: (44,15)-(44,16)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :b │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) diff --git a/test/prism/snapshots/unparser/corpus/literal/def.txt b/test/prism/snapshots/unparser/corpus/literal/def.txt index 085f0ef8b3..d1face8810 100644 --- a/test/prism/snapshots/unparser/corpus/literal/def.txt +++ b/test/prism/snapshots/unparser/corpus/literal/def.txt @@ -197,9 +197,11 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ RequiredKeywordParameterNode (location: (21,8)-(21,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :bar │ │ │ │ └── name_loc: (21,8)-(21,12) = "bar:" │ │ │ └── @ RequiredKeywordParameterNode (location: (21,14)-(21,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ └── name_loc: (21,14)-(21,18) = "baz:" │ │ ├── keyword_rest: ∅ @@ -430,6 +432,7 @@ │ │ @ ParametersNode (location: (51,8)-(51,11)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (51,8)-(51,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -459,8 +462,10 @@ │ │ @ ParametersNode (location: (55,8)-(55,16)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (55,8)-(55,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :bar │ │ │ └── @ RequiredParameterNode (location: (55,13)-(55,16)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :baz │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -491,6 +496,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (59,8)-(59,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (59,8)-(59,11) = "bar" │ │ │ ├── operator_loc: (59,12)-(59,13) = "=" @@ -527,6 +533,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (63,8)-(63,24)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (63,8)-(63,11) = "bar" │ │ │ ├── operator_loc: (63,12)-(63,13) = "=" @@ -571,6 +578,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (66,8)-(66,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (66,8)-(66,11) = "bar" │ │ │ ├── operator_loc: (66,12)-(66,13) = "=" @@ -603,9 +611,11 @@ │ │ @ ParametersNode (location: (70,8)-(70,23)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (70,8)-(70,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (70,13)-(70,23)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (70,13)-(70,16) = "baz" │ │ │ ├── operator_loc: (70,17)-(70,18) = "=" @@ -642,6 +652,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (74,8)-(74,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (74,8)-(74,12) = "bar:" │ │ │ └── value: @@ -670,6 +681,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (77,8)-(77,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (77,8)-(77,12) = "bar:" │ │ │ └── value: @@ -706,6 +718,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (80,8)-(80,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (80,8)-(80,12) = "bar:" │ │ │ └── value: @@ -740,6 +753,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (83,8)-(83,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (83,8)-(83,9) = "*" @@ -778,6 +792,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (87,8)-(87,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (87,9)-(87,12) = "bar" │ │ │ └── operator_loc: (87,8)-(87,9) = "*" @@ -807,10 +822,12 @@ │ │ @ ParametersNode (location: (91,8)-(91,17)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (91,8)-(91,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (91,13)-(91,17)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (91,14)-(91,17) = "baz" │ │ │ └── operator_loc: (91,13)-(91,14) = "*" @@ -841,6 +858,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (95,8)-(95,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (95,8)-(95,11) = "baz" │ │ │ ├── operator_loc: (95,12)-(95,13) = "=" @@ -848,6 +866,7 @@ │ │ │ @ TrueNode (location: (95,14)-(95,18)) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (95,20)-(95,24)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bor │ │ │ ├── name_loc: (95,21)-(95,24) = "bor" │ │ │ └── operator_loc: (95,20)-(95,21) = "*" @@ -885,6 +904,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (99,8)-(99,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (99,8)-(99,11) = "baz" │ │ │ ├── operator_loc: (99,12)-(99,13) = "=" @@ -892,6 +912,7 @@ │ │ │ @ TrueNode (location: (99,14)-(99,18)) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (99,20)-(99,24)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bor │ │ │ ├── name_loc: (99,21)-(99,24) = "bor" │ │ │ └── operator_loc: (99,20)-(99,21) = "*" @@ -900,6 +921,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (99,26)-(99,32)) + │ │ ├── flags: ∅ │ │ ├── name: :block │ │ ├── name_loc: (99,27)-(99,32) = "block" │ │ └── operator_loc: (99,26)-(99,27) = "&" @@ -932,9 +954,11 @@ │ │ @ ParametersNode (location: (103,8)-(103,29)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (103,8)-(103,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (103,13)-(103,23)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (103,13)-(103,16) = "baz" │ │ │ ├── operator_loc: (103,17)-(103,18) = "=" @@ -942,6 +966,7 @@ │ │ │ @ TrueNode (location: (103,19)-(103,23)) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (103,25)-(103,29)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bor │ │ │ ├── name_loc: (103,26)-(103,29) = "bor" │ │ │ └── operator_loc: (103,25)-(103,26) = "*" @@ -977,6 +1002,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (107,8)-(107,14)) + │ │ ├── flags: ∅ │ │ ├── name: :block │ │ ├── name_loc: (107,9)-(107,14) = "block" │ │ └── operator_loc: (107,8)-(107,9) = "&" @@ -1009,6 +1035,7 @@ │ │ @ ParametersNode (location: (111,8)-(111,19)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (111,8)-(111,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :bar │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -1017,6 +1044,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (111,13)-(111,19)) + │ │ ├── flags: ∅ │ │ ├── name: :block │ │ ├── name_loc: (111,14)-(111,19) = "block" │ │ └── operator_loc: (111,13)-(111,14) = "&" @@ -1082,6 +1110,7 @@ │ │ │ │ └── @ MultiTargetNode (location: (120,7)-(120,10)) │ │ │ │ ├── lefts: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (120,8)-(120,9)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) @@ -1118,9 +1147,11 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ RequiredKeywordParameterNode (location: (123,8)-(123,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :bar │ │ │ │ └── name_loc: (123,8)-(123,12) = "bar:" │ │ │ └── @ OptionalKeywordParameterNode (location: (123,14)-(123,26)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (123,14)-(123,18) = "baz:" │ │ │ └── value: diff --git a/test/prism/snapshots/unparser/corpus/literal/defs.txt b/test/prism/snapshots/unparser/corpus/literal/defs.txt index 196cef2dc5..97bf48af32 100644 --- a/test/prism/snapshots/unparser/corpus/literal/defs.txt +++ b/test/prism/snapshots/unparser/corpus/literal/defs.txt @@ -135,6 +135,7 @@ │ │ │ │ │ @ ParametersNode (location: (17,12)-(17,15)) │ │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ │ └── @ RequiredParameterNode (location: (17,12)-(17,15)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :bar │ │ │ │ │ ├── optionals: (length: 0) │ │ │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/unparser/corpus/literal/dstr.txt b/test/prism/snapshots/unparser/corpus/literal/dstr.txt index 45c399720e..a960746a3e 100644 --- a/test/prism/snapshots/unparser/corpus/literal/dstr.txt +++ b/test/prism/snapshots/unparser/corpus/literal/dstr.txt @@ -325,6 +325,7 @@ │ │ @ ParametersNode (location: (34,19)-(34,20)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (34,19)-(34,20)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/unparser/corpus/literal/if.txt b/test/prism/snapshots/unparser/corpus/literal/if.txt index 2c019ff502..08682ab155 100644 --- a/test/prism/snapshots/unparser/corpus/literal/if.txt +++ b/test/prism/snapshots/unparser/corpus/literal/if.txt @@ -239,6 +239,7 @@ │ │ │ @ ParametersNode (location: (31,10)-(31,14)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (31,10)-(31,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :pair │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/unparser/corpus/literal/lambda.txt b/test/prism/snapshots/unparser/corpus/literal/lambda.txt index 1a00ea9a59..3362989554 100644 --- a/test/prism/snapshots/unparser/corpus/literal/lambda.txt +++ b/test/prism/snapshots/unparser/corpus/literal/lambda.txt @@ -39,8 +39,10 @@ │ │ │ @ ParametersNode (location: (3,10)-(3,14)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (3,10)-(3,11)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (3,13)-(3,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -84,6 +86,7 @@ │ │ │ @ ParametersNode (location: (8,3)-(8,4)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (8,3)-(8,4)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -107,8 +110,10 @@ │ │ │ @ ParametersNode (location: (10,3)-(10,7)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (10,3)-(10,4)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (10,6)-(10,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -132,8 +137,10 @@ │ │ @ ParametersNode (location: (12,3)-(12,7)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (12,3)-(12,4)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ └── @ RequiredParameterNode (location: (12,6)-(12,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :b │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -143,6 +150,7 @@ │ │ └── block: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (12,9)-(12,10)) + │ │ ├── flags: ∅ │ │ └── name: :c │ ├── opening_loc: (12,2)-(12,3) = "(" │ └── closing_loc: (12,10)-(12,11) = ")" diff --git a/test/prism/snapshots/unparser/corpus/literal/since/31.txt b/test/prism/snapshots/unparser/corpus/literal/since/31.txt index 7a033021e2..7927a8e44a 100644 --- a/test/prism/snapshots/unparser/corpus/literal/since/31.txt +++ b/test/prism/snapshots/unparser/corpus/literal/since/31.txt @@ -17,6 +17,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,8)-(1,9) = "&" @@ -52,6 +53,7 @@ │ @ ParametersNode (location: (5,8)-(5,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (5,8)-(5,9)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 0) │ ├── rest: ∅ @@ -60,6 +62,7 @@ │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (5,11)-(5,12)) + │ ├── flags: ∅ │ ├── name: ∅ │ ├── name_loc: ∅ │ └── operator_loc: (5,11)-(5,12) = "&" diff --git a/test/prism/snapshots/unparser/corpus/literal/since/32.txt b/test/prism/snapshots/unparser/corpus/literal/since/32.txt index 1678985f7e..a202628595 100644 --- a/test/prism/snapshots/unparser/corpus/literal/since/32.txt +++ b/test/prism/snapshots/unparser/corpus/literal/since/32.txt @@ -11,6 +11,7 @@ │ │ @ ParametersNode (location: (1,8)-(1,20)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :argument │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -18,6 +19,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (1,18)-(1,20)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (1,18)-(1,20) = "**" @@ -63,10 +65,12 @@ │ @ ParametersNode (location: (5,8)-(5,19)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (5,8)-(5,16)) + │ │ ├── flags: ∅ │ │ └── name: :argument │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (5,18)-(5,19)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (5,18)-(5,19) = "*" diff --git a/test/prism/snapshots/unparser/corpus/literal/while.txt b/test/prism/snapshots/unparser/corpus/literal/while.txt index ae006ea41f..ac015b1cc6 100644 --- a/test/prism/snapshots/unparser/corpus/literal/while.txt +++ b/test/prism/snapshots/unparser/corpus/literal/while.txt @@ -31,6 +31,7 @@ │ │ │ │ @ ParametersNode (location: (2,9)-(2,12)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (2,9)-(2,12)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :bar │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ @@ -290,6 +291,7 @@ │ │ │ │ @ ParametersNode (location: (28,10)-(28,13)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (28,10)-(28,13)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :baz │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ @@ -369,6 +371,7 @@ │ │ │ │ @ ParametersNode (location: (36,10)-(36,13)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (36,10)-(36,13)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :foo │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/unparser/corpus/semantic/block.txt b/test/prism/snapshots/unparser/corpus/semantic/block.txt index c62afa6d37..55190730db 100644 --- a/test/prism/snapshots/unparser/corpus/semantic/block.txt +++ b/test/prism/snapshots/unparser/corpus/semantic/block.txt @@ -96,6 +96,7 @@ │ │ │ @ ParametersNode (location: (13,8)-(13,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -137,6 +138,7 @@ │ │ │ @ ParametersNode (location: (16,16)-(16,17)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (16,16)-(16,17)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/while.txt b/test/prism/snapshots/while.txt index bb2d86dcc7..a2919154f2 100644 --- a/test/prism/snapshots/while.txt +++ b/test/prism/snapshots/while.txt @@ -119,6 +119,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (13,19)-(13,33)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (13,19)-(13,20) = "a" │ │ │ │ ├── operator_loc: (13,21)-(13,22) = "=" diff --git a/test/prism/snapshots/whitequark/anonymous_blockarg.txt b/test/prism/snapshots/whitequark/anonymous_blockarg.txt index 8e0c70a4b3..aaeef280a0 100644 --- a/test/prism/snapshots/whitequark/anonymous_blockarg.txt +++ b/test/prism/snapshots/whitequark/anonymous_blockarg.txt @@ -17,6 +17,7 @@ │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (1,8)-(1,9)) + │ ├── flags: ∅ │ ├── name: ∅ │ ├── name_loc: ∅ │ └── operator_loc: (1,8)-(1,9) = "&" diff --git a/test/prism/snapshots/whitequark/arg.txt b/test/prism/snapshots/whitequark/arg.txt index 8e3cd2ec69..fc9f701631 100644 --- a/test/prism/snapshots/whitequark/arg.txt +++ b/test/prism/snapshots/whitequark/arg.txt @@ -11,6 +11,7 @@ │ │ @ ParametersNode (location: (1,6)-(1,9)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :foo │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -35,8 +36,10 @@ │ @ ParametersNode (location: (3,6)-(3,14)) │ ├── requireds: (length: 2) │ │ ├── @ RequiredParameterNode (location: (3,6)-(3,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :foo │ │ └── @ RequiredParameterNode (location: (3,11)-(3,14)) + │ │ ├── flags: ∅ │ │ └── name: :bar │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/arg_duplicate_ignored.txt b/test/prism/snapshots/whitequark/arg_duplicate_ignored.txt index 11a3bcc986..a0778b8f7a 100644 --- a/test/prism/snapshots/whitequark/arg_duplicate_ignored.txt +++ b/test/prism/snapshots/whitequark/arg_duplicate_ignored.txt @@ -11,8 +11,10 @@ │ │ @ ParametersNode (location: (1,8)-(1,12)) │ │ ├── requireds: (length: 2) │ │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :_ │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ ├── flags: repeated_parameter │ │ │ └── name: :_ │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -37,8 +39,10 @@ │ @ ParametersNode (location: (3,8)-(3,14)) │ ├── requireds: (length: 2) │ │ ├── @ RequiredParameterNode (location: (3,8)-(3,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :_a │ │ └── @ RequiredParameterNode (location: (3,12)-(3,14)) + │ │ ├── flags: repeated_parameter │ │ └── name: :_a │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/arg_scope.txt b/test/prism/snapshots/whitequark/arg_scope.txt index adbe43f03d..0a4788f4fd 100644 --- a/test/prism/snapshots/whitequark/arg_scope.txt +++ b/test/prism/snapshots/whitequark/arg_scope.txt @@ -21,6 +21,7 @@ │ ├── parameters: ∅ │ ├── locals: (length: 1) │ │ └── @ BlockLocalVariableNode (location: (1,9)-(1,10)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── opening_loc: (1,7)-(1,8) = "|" │ └── closing_loc: (1,10)-(1,11) = "|" diff --git a/test/prism/snapshots/whitequark/args.txt b/test/prism/snapshots/whitequark/args.txt index 3346517743..927ee3c1fe 100644 --- a/test/prism/snapshots/whitequark/args.txt +++ b/test/prism/snapshots/whitequark/args.txt @@ -17,6 +17,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (1,6)-(1,8)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (1,7)-(1,8) = "b" │ │ └── operator_loc: (1,6)-(1,7) = "&" @@ -41,6 +42,7 @@ │ │ │ │ └── @ MultiTargetNode (location: (3,8)-(3,11)) │ │ │ │ ├── lefts: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (3,9)-(3,10)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) @@ -111,6 +113,7 @@ │ │ │ │ └── expression: ∅ │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (7,11)-(7,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── lparen_loc: (7,7)-(7,8) = "(" │ │ │ └── rparen_loc: (7,12)-(7,13) = ")" @@ -143,6 +146,7 @@ │ │ │ │ ├── operator_loc: (9,8)-(9,9) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (9,9)-(9,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :r │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (9,7)-(9,8) = "(" @@ -176,9 +180,11 @@ │ │ │ │ ├── operator_loc: (11,8)-(11,9) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (11,9)-(11,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :r │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (11,12)-(11,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── lparen_loc: (11,7)-(11,8) = "(" │ │ │ └── rparen_loc: (11,13)-(11,14) = ")" @@ -207,6 +213,7 @@ │ │ │ └── @ MultiTargetNode (location: (13,7)-(13,13)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (13,8)-(13,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (13,11)-(13,12)) @@ -240,6 +247,7 @@ │ │ │ └── @ MultiTargetNode (location: (15,7)-(15,16)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (15,8)-(15,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (15,11)-(15,12)) @@ -247,6 +255,7 @@ │ │ │ │ └── expression: ∅ │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (15,14)-(15,15)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── lparen_loc: (15,7)-(15,8) = "(" │ │ │ └── rparen_loc: (15,15)-(15,16) = ")" @@ -275,12 +284,14 @@ │ │ │ └── @ MultiTargetNode (location: (17,7)-(17,14)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (17,8)-(17,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (17,11)-(17,13)) │ │ │ │ ├── operator_loc: (17,11)-(17,12) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (17,12)-(17,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :r │ │ │ ├── rights: (length: 0) │ │ │ ├── lparen_loc: (17,7)-(17,8) = "(" @@ -310,15 +321,18 @@ │ │ │ └── @ MultiTargetNode (location: (19,7)-(19,17)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (19,8)-(19,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (19,11)-(19,13)) │ │ │ │ ├── operator_loc: (19,11)-(19,12) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (19,12)-(19,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :r │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (19,15)-(19,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── lparen_loc: (19,7)-(19,8) = "(" │ │ │ └── rparen_loc: (19,16)-(19,17) = ")" @@ -347,8 +361,10 @@ │ │ │ └── @ MultiTargetNode (location: (21,7)-(21,14)) │ │ │ ├── lefts: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (21,8)-(21,9)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (21,11)-(21,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a1 │ │ │ ├── rest: ∅ │ │ │ ├── rights: (length: 0) @@ -381,6 +397,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (23,7)-(23,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ ├── name_loc: (23,7)-(23,11) = "foo:" │ │ │ └── value: @@ -389,6 +406,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (23,15)-(23,17)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (23,16)-(23,17) = "b" │ │ └── operator_loc: (23,15)-(23,16) = "&" @@ -413,12 +431,14 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 2) │ │ │ ├── @ OptionalKeywordParameterNode (location: (25,7)-(25,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :foo │ │ │ │ ├── name_loc: (25,7)-(25,11) = "foo:" │ │ │ │ └── value: │ │ │ │ @ IntegerNode (location: (25,12)-(25,13)) │ │ │ │ └── flags: decimal │ │ │ └── @ OptionalKeywordParameterNode (location: (25,15)-(25,21)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :bar │ │ │ ├── name_loc: (25,15)-(25,19) = "bar:" │ │ │ └── value: @@ -426,11 +446,13 @@ │ │ │ └── flags: decimal │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (25,23)-(25,28)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (25,25)-(25,28) = "baz" │ │ │ └── operator_loc: (25,23)-(25,25) = "**" │ │ └── block: │ │ @ BlockParameterNode (location: (25,30)-(25,32)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (25,31)-(25,32) = "b" │ │ └── operator_loc: (25,30)-(25,31) = "&" @@ -456,11 +478,13 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (27,6)-(27,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :baz │ │ │ ├── name_loc: (27,8)-(27,11) = "baz" │ │ │ └── operator_loc: (27,6)-(27,8) = "**" │ │ └── block: │ │ @ BlockParameterNode (location: (27,13)-(27,15)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (27,14)-(27,15) = "b" │ │ └── operator_loc: (27,13)-(27,14) = "&" @@ -483,6 +507,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (29,6)-(29,7)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (29,6)-(29,7) = "*" @@ -490,6 +515,7 @@ │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: │ │ │ @ KeywordRestParameterNode (location: (29,9)-(29,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: ∅ │ │ │ ├── name_loc: ∅ │ │ │ └── operator_loc: (29,9)-(29,11) = "**" @@ -513,6 +539,7 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (31,6)-(31,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (31,7)-(31,8) = "r" │ │ │ └── operator_loc: (31,6)-(31,7) = "*" @@ -521,6 +548,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (31,10)-(31,12)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (31,11)-(31,12) = "b" │ │ └── operator_loc: (31,10)-(31,11) = "&" @@ -543,16 +571,19 @@ │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (33,6)-(33,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (33,7)-(33,8) = "r" │ │ │ └── operator_loc: (33,6)-(33,7) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (33,10)-(33,11)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :p │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (33,13)-(33,15)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (33,14)-(33,15) = "b" │ │ └── operator_loc: (33,13)-(33,14) = "&" @@ -587,6 +618,7 @@ │ │ @ ParametersNode (location: (37,6)-(37,11)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (37,6)-(37,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -595,6 +627,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (37,9)-(37,11)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (37,10)-(37,11) = "b" │ │ └── operator_loc: (37,9)-(37,10) = "&" @@ -615,10 +648,12 @@ │ │ @ ParametersNode (location: (39,6)-(39,15)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (39,6)-(39,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (39,9)-(39,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (39,10)-(39,11) = "r" │ │ │ └── operator_loc: (39,9)-(39,10) = "*" @@ -627,6 +662,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (39,13)-(39,15)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (39,14)-(39,15) = "b" │ │ └── operator_loc: (39,13)-(39,14) = "&" @@ -647,20 +683,24 @@ │ │ @ ParametersNode (location: (41,6)-(41,18)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (41,6)-(41,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: │ │ │ @ RestParameterNode (location: (41,9)-(41,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (41,10)-(41,11) = "r" │ │ │ └── operator_loc: (41,9)-(41,10) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (41,13)-(41,14)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :p │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (41,16)-(41,18)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (41,17)-(41,18) = "b" │ │ └── operator_loc: (41,16)-(41,17) = "&" @@ -681,9 +721,11 @@ │ │ @ ParametersNode (location: (43,6)-(43,16)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (43,6)-(43,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (43,9)-(43,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (43,9)-(43,10) = "o" │ │ │ ├── operator_loc: (43,10)-(43,11) = "=" @@ -696,6 +738,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (43,14)-(43,16)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (43,15)-(43,16) = "b" │ │ └── operator_loc: (43,14)-(43,15) = "&" @@ -716,9 +759,11 @@ │ │ @ ParametersNode (location: (45,6)-(45,20)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (45,6)-(45,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (45,9)-(45,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (45,9)-(45,10) = "o" │ │ │ ├── operator_loc: (45,10)-(45,11) = "=" @@ -727,6 +772,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (45,14)-(45,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (45,15)-(45,16) = "r" │ │ │ └── operator_loc: (45,14)-(45,15) = "*" @@ -735,6 +781,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (45,18)-(45,20)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (45,19)-(45,20) = "b" │ │ └── operator_loc: (45,18)-(45,19) = "&" @@ -755,9 +802,11 @@ │ │ @ ParametersNode (location: (47,6)-(47,23)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (47,6)-(47,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (47,9)-(47,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (47,9)-(47,10) = "o" │ │ │ ├── operator_loc: (47,10)-(47,11) = "=" @@ -766,16 +815,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (47,14)-(47,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (47,15)-(47,16) = "r" │ │ │ └── operator_loc: (47,14)-(47,15) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (47,18)-(47,19)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :p │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (47,21)-(47,23)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (47,22)-(47,23) = "b" │ │ └── operator_loc: (47,21)-(47,22) = "&" @@ -796,9 +848,11 @@ │ │ @ ParametersNode (location: (49,6)-(49,19)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (49,6)-(49,7)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (49,9)-(49,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (49,9)-(49,10) = "o" │ │ │ ├── operator_loc: (49,10)-(49,11) = "=" @@ -808,11 +862,13 @@ │ │ ├── rest: ∅ │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (49,14)-(49,15)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :p │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (49,17)-(49,19)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (49,18)-(49,19) = "b" │ │ └── operator_loc: (49,17)-(49,18) = "&" @@ -837,6 +893,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (51,6)-(51,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ └── name_loc: (51,6)-(51,10) = "foo:" │ │ ├── keyword_rest: ∅ @@ -862,6 +919,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ OptionalKeywordParameterNode (location: (54,6)-(54,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ ├── name_loc: (54,6)-(54,10) = "foo:" │ │ │ └── value: @@ -887,6 +945,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (57,6)-(57,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (57,6)-(57,7) = "o" │ │ │ ├── operator_loc: (57,7)-(57,8) = "=" @@ -899,6 +958,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (57,11)-(57,13)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (57,12)-(57,13) = "b" │ │ └── operator_loc: (57,11)-(57,12) = "&" @@ -920,6 +980,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (59,6)-(59,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (59,6)-(59,7) = "o" │ │ │ ├── operator_loc: (59,7)-(59,8) = "=" @@ -928,6 +989,7 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (59,11)-(59,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (59,12)-(59,13) = "r" │ │ │ └── operator_loc: (59,11)-(59,12) = "*" @@ -936,6 +998,7 @@ │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (59,15)-(59,17)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (59,16)-(59,17) = "b" │ │ └── operator_loc: (59,15)-(59,16) = "&" @@ -957,6 +1020,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (61,6)-(61,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :o │ │ │ ├── name_loc: (61,6)-(61,7) = "o" │ │ │ ├── operator_loc: (61,7)-(61,8) = "=" @@ -965,16 +1029,19 @@ │ │ │ └── flags: decimal │ │ ├── rest: │ │ │ @ RestParameterNode (location: (61,11)-(61,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :r │ │ │ ├── name_loc: (61,12)-(61,13) = "r" │ │ │ └── operator_loc: (61,11)-(61,12) = "*" │ │ ├── posts: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (61,15)-(61,16)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :p │ │ ├── keywords: (length: 0) │ │ ├── keyword_rest: ∅ │ │ └── block: │ │ @ BlockParameterNode (location: (61,18)-(61,20)) + │ │ ├── flags: ∅ │ │ ├── name: :b │ │ ├── name_loc: (61,19)-(61,20) = "b" │ │ └── operator_loc: (61,18)-(61,19) = "&" @@ -996,6 +1063,7 @@ │ ├── requireds: (length: 0) │ ├── optionals: (length: 1) │ │ └── @ OptionalParameterNode (location: (63,6)-(63,9)) + │ │ ├── flags: ∅ │ │ ├── name: :o │ │ ├── name_loc: (63,6)-(63,7) = "o" │ │ ├── operator_loc: (63,7)-(63,8) = "=" @@ -1005,11 +1073,13 @@ │ ├── rest: ∅ │ ├── posts: (length: 1) │ │ └── @ RequiredParameterNode (location: (63,11)-(63,12)) + │ │ ├── flags: ∅ │ │ └── name: :p │ ├── keywords: (length: 0) │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (63,14)-(63,16)) + │ ├── flags: ∅ │ ├── name: :b │ ├── name_loc: (63,15)-(63,16) = "b" │ └── operator_loc: (63,14)-(63,15) = "&" diff --git a/test/prism/snapshots/whitequark/blockarg.txt b/test/prism/snapshots/whitequark/blockarg.txt index ce3bb106b5..fd0dac3cb2 100644 --- a/test/prism/snapshots/whitequark/blockarg.txt +++ b/test/prism/snapshots/whitequark/blockarg.txt @@ -17,6 +17,7 @@ │ ├── keyword_rest: ∅ │ └── block: │ @ BlockParameterNode (location: (1,6)-(1,12)) + │ ├── flags: ∅ │ ├── name: :block │ ├── name_loc: (1,7)-(1,12) = "block" │ └── operator_loc: (1,6)-(1,7) = "&" diff --git a/test/prism/snapshots/whitequark/blockargs.txt b/test/prism/snapshots/whitequark/blockargs.txt index 6e87c70633..36610d66bf 100644 --- a/test/prism/snapshots/whitequark/blockargs.txt +++ b/test/prism/snapshots/whitequark/blockargs.txt @@ -67,6 +67,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (5,4)-(5,6)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (5,5)-(5,6) = "b" │ │ │ └── operator_loc: (5,4)-(5,5) = "&" @@ -100,11 +101,13 @@ │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: │ │ │ │ @ KeywordRestParameterNode (location: (7,4)-(7,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :baz │ │ │ │ ├── name_loc: (7,6)-(7,9) = "baz" │ │ │ │ └── operator_loc: (7,4)-(7,6) = "**" │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (7,11)-(7,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (7,12)-(7,13) = "b" │ │ │ └── operator_loc: (7,11)-(7,12) = "&" @@ -135,6 +138,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (9,4)-(9,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (9,4)-(9,5) = "*" @@ -143,6 +147,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (9,7)-(9,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (9,8)-(9,9) = "b" │ │ │ └── operator_loc: (9,7)-(9,8) = "&" @@ -173,16 +178,19 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (11,4)-(11,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (11,5)-(11,6) = "r" │ │ │ │ └── operator_loc: (11,4)-(11,5) = "*" │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (11,8)-(11,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (11,11)-(11,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (11,12)-(11,13) = "b" │ │ │ └── operator_loc: (11,11)-(11,12) = "&" @@ -213,6 +221,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (13,4)-(13,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :s │ │ │ │ ├── name_loc: (13,5)-(13,6) = "s" │ │ │ │ └── operator_loc: (13,4)-(13,5) = "*" @@ -221,6 +230,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (13,8)-(13,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (13,9)-(13,10) = "b" │ │ │ └── operator_loc: (13,8)-(13,9) = "&" @@ -251,6 +261,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (15,4)-(15,6)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :s │ │ │ │ ├── name_loc: (15,5)-(15,6) = "s" │ │ │ │ └── operator_loc: (15,4)-(15,5) = "*" @@ -285,6 +296,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (17,4)-(17,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (17,4)-(17,5) = "*" @@ -316,6 +328,7 @@ │ │ ├── parameters: ∅ │ │ ├── locals: (length: 1) │ │ │ └── @ BlockLocalVariableNode (location: (20,0)-(20,1)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── opening_loc: (19,3)-(19,4) = "|" │ │ └── closing_loc: (21,0)-(21,1) = "|" @@ -340,6 +353,7 @@ │ │ ├── parameters: ∅ │ │ ├── locals: (length: 1) │ │ │ └── @ BlockLocalVariableNode (location: (23,5)-(23,6)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── opening_loc: (23,3)-(23,4) = "|" │ │ └── closing_loc: (23,6)-(23,7) = "|" @@ -365,6 +379,7 @@ │ │ │ @ ParametersNode (location: (25,4)-(25,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (25,4)-(25,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -373,6 +388,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (25,7)-(25,9)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (25,8)-(25,9) = "b" │ │ │ └── operator_loc: (25,7)-(25,8) = "&" @@ -401,10 +417,12 @@ │ │ │ @ ParametersNode (location: (27,4)-(27,12)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (27,4)-(27,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (27,7)-(27,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (27,7)-(27,8) = "*" @@ -413,6 +431,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (27,10)-(27,12)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (27,11)-(27,12) = "b" │ │ │ └── operator_loc: (27,10)-(27,11) = "&" @@ -441,20 +460,24 @@ │ │ │ @ ParametersNode (location: (29,4)-(29,16)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (29,4)-(29,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (29,7)-(29,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (29,8)-(29,9) = "r" │ │ │ │ └── operator_loc: (29,7)-(29,8) = "*" │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (29,11)-(29,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (29,14)-(29,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (29,15)-(29,16) = "b" │ │ │ └── operator_loc: (29,14)-(29,15) = "&" @@ -483,10 +506,12 @@ │ │ │ @ ParametersNode (location: (31,4)-(31,13)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (31,4)-(31,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (31,7)-(31,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :s │ │ │ │ ├── name_loc: (31,8)-(31,9) = "s" │ │ │ │ └── operator_loc: (31,7)-(31,8) = "*" @@ -495,6 +520,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (31,11)-(31,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (31,12)-(31,13) = "b" │ │ │ └── operator_loc: (31,11)-(31,12) = "&" @@ -523,10 +549,12 @@ │ │ │ @ ParametersNode (location: (33,4)-(33,9)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (33,4)-(33,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (33,7)-(33,9)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :s │ │ │ │ ├── name_loc: (33,8)-(33,9) = "s" │ │ │ │ └── operator_loc: (33,7)-(33,8) = "*" @@ -559,10 +587,12 @@ │ │ │ @ ParametersNode (location: (35,4)-(35,8)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (35,4)-(35,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (35,7)-(35,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (35,7)-(35,8) = "*" @@ -595,8 +625,10 @@ │ │ │ @ ParametersNode (location: (37,4)-(37,9)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (37,4)-(37,5)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (37,7)-(37,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: @@ -630,8 +662,10 @@ │ │ │ @ ParametersNode (location: (39,4)-(39,8)) │ │ │ ├── requireds: (length: 2) │ │ │ │ ├── @ RequiredParameterNode (location: (39,4)-(39,5)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ └── @ RequiredParameterNode (location: (39,7)-(39,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -664,9 +698,11 @@ │ │ │ @ ParametersNode (location: (41,4)-(41,14)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (41,4)-(41,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (41,7)-(41,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (41,7)-(41,8) = "o" │ │ │ │ ├── operator_loc: (41,8)-(41,9) = "=" @@ -679,6 +715,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (41,12)-(41,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (41,13)-(41,14) = "b" │ │ │ └── operator_loc: (41,12)-(41,13) = "&" @@ -707,9 +744,11 @@ │ │ │ @ ParametersNode (location: (43,4)-(43,21)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (43,4)-(43,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (43,7)-(43,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (43,7)-(43,8) = "o" │ │ │ │ ├── operator_loc: (43,8)-(43,9) = "=" @@ -718,16 +757,19 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (43,12)-(43,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (43,13)-(43,14) = "r" │ │ │ │ └── operator_loc: (43,12)-(43,13) = "*" │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (43,16)-(43,17)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (43,19)-(43,21)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (43,20)-(43,21) = "b" │ │ │ └── operator_loc: (43,19)-(43,20) = "&" @@ -756,9 +798,11 @@ │ │ │ @ ParametersNode (location: (45,4)-(45,24)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (45,4)-(45,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 2) │ │ │ │ ├── @ OptionalParameterNode (location: (45,7)-(45,10)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :o │ │ │ │ │ ├── name_loc: (45,7)-(45,8) = "o" │ │ │ │ │ ├── operator_loc: (45,8)-(45,9) = "=" @@ -766,6 +810,7 @@ │ │ │ │ │ @ IntegerNode (location: (45,9)-(45,10)) │ │ │ │ │ └── flags: decimal │ │ │ │ └── @ OptionalParameterNode (location: (45,12)-(45,16)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o1 │ │ │ │ ├── name_loc: (45,12)-(45,14) = "o1" │ │ │ │ ├── operator_loc: (45,14)-(45,15) = "=" @@ -774,6 +819,7 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (45,18)-(45,20)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (45,19)-(45,20) = "r" │ │ │ │ └── operator_loc: (45,18)-(45,19) = "*" @@ -782,6 +828,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (45,22)-(45,24)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (45,23)-(45,24) = "b" │ │ │ └── operator_loc: (45,22)-(45,23) = "&" @@ -810,9 +857,11 @@ │ │ │ @ ParametersNode (location: (47,4)-(47,17)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (47,4)-(47,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (47,7)-(47,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (47,7)-(47,8) = "o" │ │ │ │ ├── operator_loc: (47,8)-(47,9) = "=" @@ -822,11 +871,13 @@ │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (47,12)-(47,13)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (47,15)-(47,17)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (47,16)-(47,17) = "b" │ │ │ └── operator_loc: (47,15)-(47,16) = "&" @@ -855,6 +906,7 @@ │ │ │ @ ParametersNode (location: (49,4)-(49,6)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (49,4)-(49,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: @@ -888,6 +940,7 @@ │ │ │ @ ParametersNode (location: (51,4)-(51,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (51,4)-(51,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -920,6 +973,7 @@ │ │ │ @ ParametersNode (location: (53,4)-(53,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (53,4)-(53,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -952,6 +1006,7 @@ │ │ │ @ ParametersNode (location: (55,4)-(55,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (55,4)-(55,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -988,6 +1043,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ OptionalKeywordParameterNode (location: (57,4)-(57,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :foo │ │ │ │ ├── name_loc: (57,4)-(57,8) = "foo:" │ │ │ │ └── value: @@ -996,6 +1052,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (57,12)-(57,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (57,13)-(57,14) = "b" │ │ │ └── operator_loc: (57,12)-(57,13) = "&" @@ -1028,12 +1085,14 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 2) │ │ │ │ ├── @ OptionalKeywordParameterNode (location: (59,4)-(59,10)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :foo │ │ │ │ │ ├── name_loc: (59,4)-(59,8) = "foo:" │ │ │ │ │ └── value: │ │ │ │ │ @ IntegerNode (location: (59,9)-(59,10)) │ │ │ │ │ └── flags: decimal │ │ │ │ └── @ OptionalKeywordParameterNode (location: (59,12)-(59,18)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :bar │ │ │ │ ├── name_loc: (59,12)-(59,16) = "bar:" │ │ │ │ └── value: @@ -1041,11 +1100,13 @@ │ │ │ │ └── flags: decimal │ │ │ ├── keyword_rest: │ │ │ │ @ KeywordRestParameterNode (location: (59,20)-(59,25)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :baz │ │ │ │ ├── name_loc: (59,22)-(59,25) = "baz" │ │ │ │ └── operator_loc: (59,20)-(59,22) = "**" │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (59,27)-(59,29)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (59,28)-(59,29) = "b" │ │ │ └── operator_loc: (59,27)-(59,28) = "&" @@ -1078,6 +1139,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ RequiredKeywordParameterNode (location: (61,4)-(61,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :foo │ │ │ │ └── name_loc: (61,4)-(61,8) = "foo:" │ │ │ ├── keyword_rest: ∅ @@ -1108,6 +1170,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (63,4)-(63,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (63,4)-(63,5) = "o" │ │ │ │ ├── operator_loc: (63,5)-(63,6) = "=" @@ -1120,6 +1183,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (63,9)-(63,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (63,10)-(63,11) = "b" │ │ │ └── operator_loc: (63,9)-(63,10) = "&" @@ -1149,6 +1213,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (65,4)-(65,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (65,4)-(65,5) = "o" │ │ │ │ ├── operator_loc: (65,5)-(65,6) = "=" @@ -1157,6 +1222,7 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (65,9)-(65,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (65,10)-(65,11) = "r" │ │ │ │ └── operator_loc: (65,9)-(65,10) = "*" @@ -1165,6 +1231,7 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (65,13)-(65,15)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (65,14)-(65,15) = "b" │ │ │ └── operator_loc: (65,13)-(65,14) = "&" @@ -1194,6 +1261,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (67,4)-(67,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (67,4)-(67,5) = "o" │ │ │ │ ├── operator_loc: (67,5)-(67,6) = "=" @@ -1202,16 +1270,19 @@ │ │ │ │ └── flags: decimal │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (67,9)-(67,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :r │ │ │ │ ├── name_loc: (67,10)-(67,11) = "r" │ │ │ │ └── operator_loc: (67,9)-(67,10) = "*" │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (67,13)-(67,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (67,16)-(67,18)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (67,17)-(67,18) = "b" │ │ │ └── operator_loc: (67,16)-(67,17) = "&" @@ -1241,6 +1312,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (69,4)-(69,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :o │ │ │ │ ├── name_loc: (69,4)-(69,5) = "o" │ │ │ │ ├── operator_loc: (69,5)-(69,6) = "=" @@ -1250,11 +1322,13 @@ │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (69,9)-(69,10)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :p │ │ │ ├── keywords: (length: 0) │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: │ │ │ @ BlockParameterNode (location: (69,12)-(69,14)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (69,13)-(69,14) = "b" │ │ │ └── operator_loc: (69,12)-(69,13) = "&" diff --git a/test/prism/snapshots/whitequark/bug_435.txt b/test/prism/snapshots/whitequark/bug_435.txt index afce74425e..20210c87df 100644 --- a/test/prism/snapshots/whitequark/bug_435.txt +++ b/test/prism/snapshots/whitequark/bug_435.txt @@ -23,6 +23,7 @@ │ │ │ │ @ ParametersNode (location: (1,6)-(1,9)) │ │ │ │ ├── requireds: (length: 1) │ │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,9)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :foo │ │ │ │ ├── optionals: (length: 0) │ │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/bug_lambda_leakage.txt b/test/prism/snapshots/whitequark/bug_lambda_leakage.txt index 96af5544b9..a8f2721cb8 100644 --- a/test/prism/snapshots/whitequark/bug_lambda_leakage.txt +++ b/test/prism/snapshots/whitequark/bug_lambda_leakage.txt @@ -15,6 +15,7 @@ │ │ │ @ ParametersNode (location: (1,3)-(1,8)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,8)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :scope │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/endless_comparison_method.txt b/test/prism/snapshots/whitequark/endless_comparison_method.txt index c8a9a4c624..82f574df0d 100644 --- a/test/prism/snapshots/whitequark/endless_comparison_method.txt +++ b/test/prism/snapshots/whitequark/endless_comparison_method.txt @@ -11,6 +11,7 @@ │ │ @ ParametersNode (location: (1,7)-(1,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,7)-(1,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :other │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -47,6 +48,7 @@ │ │ @ ParametersNode (location: (3,7)-(3,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (3,7)-(3,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :other │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -83,6 +85,7 @@ │ │ @ ParametersNode (location: (5,7)-(5,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (5,7)-(5,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :other │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -119,6 +122,7 @@ │ │ @ ParametersNode (location: (7,7)-(7,12)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (7,7)-(7,12)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :other │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -155,6 +159,7 @@ │ │ @ ParametersNode (location: (9,8)-(9,13)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (9,8)-(9,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :other │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -191,6 +196,7 @@ │ @ ParametersNode (location: (11,7)-(11,12)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (11,7)-(11,12)) + │ │ ├── flags: ∅ │ │ └── name: :other │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/endless_method.txt b/test/prism/snapshots/whitequark/endless_method.txt index ab826ccfe1..3d681ca459 100644 --- a/test/prism/snapshots/whitequark/endless_method.txt +++ b/test/prism/snapshots/whitequark/endless_method.txt @@ -29,6 +29,7 @@ │ │ @ ParametersNode (location: (3,8)-(3,9)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (3,8)-(3,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -111,6 +112,7 @@ │ @ ParametersNode (location: (7,12)-(7,13)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (7,12)-(7,13)) + │ │ ├── flags: ∅ │ │ └── name: :x │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/endless_method_command_syntax.txt b/test/prism/snapshots/whitequark/endless_method_command_syntax.txt index c6d5e7150a..c4db8a106f 100644 --- a/test/prism/snapshots/whitequark/endless_method_command_syntax.txt +++ b/test/prism/snapshots/whitequark/endless_method_command_syntax.txt @@ -81,6 +81,7 @@ │ │ @ ParametersNode (location: (5,8)-(5,9)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (5,8)-(5,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -223,6 +224,7 @@ │ │ @ ParametersNode (location: (11,12)-(11,13)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (11,12)-(11,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -265,6 +267,7 @@ │ │ @ ParametersNode (location: (13,12)-(13,13)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (13,12)-(13,13)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :x │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -334,6 +337,7 @@ │ @ ParametersNode (location: (15,17)-(15,18)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (15,17)-(15,18)) + │ │ ├── flags: ∅ │ │ └── name: :x │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/forward_arg_with_open_args.txt b/test/prism/snapshots/whitequark/forward_arg_with_open_args.txt index 9735edb5ef..75fb87e0e7 100644 --- a/test/prism/snapshots/whitequark/forward_arg_with_open_args.txt +++ b/test/prism/snapshots/whitequark/forward_arg_with_open_args.txt @@ -163,6 +163,7 @@ │ │ @ ParametersNode (location: (12,8)-(12,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (12,8)-(12,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -204,6 +205,7 @@ │ │ @ ParametersNode (location: (16,8)-(16,14)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (16,8)-(16,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -245,9 +247,11 @@ │ │ @ ParametersNode (location: (18,8)-(18,21)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (18,8)-(18,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (18,11)-(18,16)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (18,11)-(18,12) = "b" │ │ │ ├── operator_loc: (18,13)-(18,14) = "=" @@ -278,6 +282,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (21,8)-(21,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (21,8)-(21,9) = "b" │ │ │ ├── operator_loc: (21,10)-(21,11) = "=" @@ -324,6 +329,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (25,8)-(25,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ ├── name_loc: (25,8)-(25,9) = "b" │ │ │ ├── operator_loc: (25,10)-(25,11) = "=" @@ -369,6 +375,7 @@ │ @ ParametersNode (location: (27,8)-(27,14)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (27,8)-(27,9)) + │ │ ├── flags: ∅ │ │ └── name: :a │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt b/test/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt index 3e1f113611..ff7a094575 100644 --- a/test/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt +++ b/test/prism/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt @@ -11,6 +11,7 @@ │ @ ParametersNode (location: (1,8)-(1,20)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ │ │ └── name: :argument │ ├── optionals: (length: 0) │ ├── rest: ∅ @@ -18,6 +19,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,18)-(1,20)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,18)-(1,20) = "**" diff --git a/test/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt b/test/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt index 76531aa707..249a6260ce 100644 --- a/test/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt +++ b/test/prism/snapshots/whitequark/forwarded_argument_with_restarg.txt @@ -11,10 +11,12 @@ │ @ ParametersNode (location: (1,8)-(1,19)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ │ │ └── name: :argument │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,18)-(1,19)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,18)-(1,19) = "*" diff --git a/test/prism/snapshots/whitequark/forwarded_kwrestarg.txt b/test/prism/snapshots/whitequark/forwarded_kwrestarg.txt index 23dc2d1646..bd2f55aeba 100644 --- a/test/prism/snapshots/whitequark/forwarded_kwrestarg.txt +++ b/test/prism/snapshots/whitequark/forwarded_kwrestarg.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,8)-(1,10) = "**" diff --git a/test/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt b/test/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt index a532391b3f..0af593e9e9 100644 --- a/test/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt +++ b/test/prism/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,8)-(1,10) = "**" diff --git a/test/prism/snapshots/whitequark/forwarded_restarg.txt b/test/prism/snapshots/whitequark/forwarded_restarg.txt index c05180b808..43e514bde5 100644 --- a/test/prism/snapshots/whitequark/forwarded_restarg.txt +++ b/test/prism/snapshots/whitequark/forwarded_restarg.txt @@ -13,6 +13,7 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,8)-(1,9) = "*" diff --git a/test/prism/snapshots/whitequark/kwarg.txt b/test/prism/snapshots/whitequark/kwarg.txt index ad1c1752bf..6f54b17f6e 100644 --- a/test/prism/snapshots/whitequark/kwarg.txt +++ b/test/prism/snapshots/whitequark/kwarg.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :foo │ │ └── name_loc: (1,6)-(1,10) = "foo:" │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/whitequark/kwoptarg.txt b/test/prism/snapshots/whitequark/kwoptarg.txt index e1fe137c2f..dbe465e80c 100644 --- a/test/prism/snapshots/whitequark/kwoptarg.txt +++ b/test/prism/snapshots/whitequark/kwoptarg.txt @@ -15,6 +15,7 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :foo │ │ ├── name_loc: (1,6)-(1,10) = "foo:" │ │ └── value: diff --git a/test/prism/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt b/test/prism/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt index 2a003a80e7..f39e6e4466 100644 --- a/test/prism/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt +++ b/test/prism/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt @@ -15,12 +15,14 @@ │ ├── posts: (length: 0) │ ├── keywords: (length: 1) │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,12)) + │ │ ├── flags: ∅ │ │ ├── name: :a │ │ ├── name_loc: (1,6)-(1,8) = "a:" │ │ └── value: │ │ @ NilNode (location: (1,9)-(1,12)) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,14)-(1,16)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,14)-(1,16) = "**" diff --git a/test/prism/snapshots/whitequark/kwrestarg_named.txt b/test/prism/snapshots/whitequark/kwrestarg_named.txt index 73c73087da..a31787e3d6 100644 --- a/test/prism/snapshots/whitequark/kwrestarg_named.txt +++ b/test/prism/snapshots/whitequark/kwrestarg_named.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,6)-(1,11)) + │ │ ├── flags: ∅ │ │ ├── name: :foo │ │ ├── name_loc: (1,8)-(1,11) = "foo" │ │ └── operator_loc: (1,6)-(1,8) = "**" diff --git a/test/prism/snapshots/whitequark/kwrestarg_unnamed.txt b/test/prism/snapshots/whitequark/kwrestarg_unnamed.txt index be042c7609..564dfbcd6f 100644 --- a/test/prism/snapshots/whitequark/kwrestarg_unnamed.txt +++ b/test/prism/snapshots/whitequark/kwrestarg_unnamed.txt @@ -16,6 +16,7 @@ │ ├── keywords: (length: 0) │ ├── keyword_rest: │ │ @ KeywordRestParameterNode (location: (1,6)-(1,8)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,6)-(1,8) = "**" diff --git a/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt b/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt index 1ca0c3e79a..ca1cd594c5 100644 --- a/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt +++ b/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt @@ -17,6 +17,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (1,14)-(1,28)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (1,14)-(1,15) = "a" │ │ │ │ ├── operator_loc: (1,16)-(1,17) = "=" @@ -117,6 +118,7 @@ │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) │ │ │ │ └── @ OptionalParameterNode (location: (5,19)-(5,33)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (5,19)-(5,20) = "a" │ │ │ │ ├── operator_loc: (5,21)-(5,22) = "=" diff --git a/test/prism/snapshots/whitequark/optarg.txt b/test/prism/snapshots/whitequark/optarg.txt index 5a192fc360..ed8c1be940 100644 --- a/test/prism/snapshots/whitequark/optarg.txt +++ b/test/prism/snapshots/whitequark/optarg.txt @@ -12,6 +12,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,13)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ ├── name_loc: (1,6)-(1,9) = "foo" │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" @@ -41,6 +42,7 @@ │ ├── requireds: (length: 0) │ ├── optionals: (length: 2) │ │ ├── @ OptionalParameterNode (location: (3,6)-(3,11)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :foo │ │ │ ├── name_loc: (3,6)-(3,9) = "foo" │ │ │ ├── operator_loc: (3,9)-(3,10) = "=" @@ -48,6 +50,7 @@ │ │ │ @ IntegerNode (location: (3,10)-(3,11)) │ │ │ └── flags: decimal │ │ └── @ OptionalParameterNode (location: (3,13)-(3,18)) + │ │ ├── flags: ∅ │ │ ├── name: :bar │ │ ├── name_loc: (3,13)-(3,16) = "bar" │ │ ├── operator_loc: (3,16)-(3,17) = "=" diff --git a/test/prism/snapshots/whitequark/parser_bug_272.txt b/test/prism/snapshots/whitequark/parser_bug_272.txt index 173b4df60d..193c324524 100644 --- a/test/prism/snapshots/whitequark/parser_bug_272.txt +++ b/test/prism/snapshots/whitequark/parser_bug_272.txt @@ -27,6 +27,7 @@ │ │ @ ParametersNode (location: (1,9)-(1,10)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :c │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/parser_bug_507.txt b/test/prism/snapshots/whitequark/parser_bug_507.txt index b8f9c0f83f..294e78a2f1 100644 --- a/test/prism/snapshots/whitequark/parser_bug_507.txt +++ b/test/prism/snapshots/whitequark/parser_bug_507.txt @@ -22,6 +22,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (1,7)-(1,12)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :args │ │ │ │ ├── name_loc: (1,8)-(1,12) = "args" │ │ │ │ └── operator_loc: (1,7)-(1,8) = "*" diff --git a/test/prism/snapshots/whitequark/parser_bug_645.txt b/test/prism/snapshots/whitequark/parser_bug_645.txt index 16b1e171d2..a2d0d3d28c 100644 --- a/test/prism/snapshots/whitequark/parser_bug_645.txt +++ b/test/prism/snapshots/whitequark/parser_bug_645.txt @@ -16,6 +16,7 @@ │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 1) │ │ │ └── @ OptionalParameterNode (location: (1,4)-(1,10)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :arg │ │ │ ├── name_loc: (1,4)-(1,7) = "arg" │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" diff --git a/test/prism/snapshots/whitequark/procarg0.txt b/test/prism/snapshots/whitequark/procarg0.txt index d0dacfd387..09b24c2f7c 100644 --- a/test/prism/snapshots/whitequark/procarg0.txt +++ b/test/prism/snapshots/whitequark/procarg0.txt @@ -24,8 +24,10 @@ │ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) │ │ │ │ ├── lefts: (length: 2) │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,9)) + │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :foo │ │ │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,14)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :bar │ │ │ │ ├── rest: ∅ │ │ │ │ ├── rights: (length: 0) @@ -62,6 +64,7 @@ │ │ @ ParametersNode (location: (3,5)-(3,8)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (3,5)-(3,8)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :foo │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/restarg_named.txt b/test/prism/snapshots/whitequark/restarg_named.txt index b61f1fb929..02acbfde84 100644 --- a/test/prism/snapshots/whitequark/restarg_named.txt +++ b/test/prism/snapshots/whitequark/restarg_named.txt @@ -13,6 +13,7 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ │ │ ├── name: :foo │ │ ├── name_loc: (1,7)-(1,10) = "foo" │ │ └── operator_loc: (1,6)-(1,7) = "*" diff --git a/test/prism/snapshots/whitequark/restarg_unnamed.txt b/test/prism/snapshots/whitequark/restarg_unnamed.txt index 0879ffa3ee..388dad1972 100644 --- a/test/prism/snapshots/whitequark/restarg_unnamed.txt +++ b/test/prism/snapshots/whitequark/restarg_unnamed.txt @@ -13,6 +13,7 @@ │ ├── optionals: (length: 0) │ ├── rest: │ │ @ RestParameterNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ │ │ ├── name: ∅ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,6)-(1,7) = "*" diff --git a/test/prism/snapshots/whitequark/ruby_bug_10653.txt b/test/prism/snapshots/whitequark/ruby_bug_10653.txt index a0d088d104..ed8d43d1f2 100644 --- a/test/prism/snapshots/whitequark/ruby_bug_10653.txt +++ b/test/prism/snapshots/whitequark/ruby_bug_10653.txt @@ -132,6 +132,7 @@ │ │ │ @ ParametersNode (location: (5,17)-(5,18)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :n │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/ruby_bug_12073.txt b/test/prism/snapshots/whitequark/ruby_bug_12073.txt index f5d11b102d..3ac68ad707 100644 --- a/test/prism/snapshots/whitequark/ruby_bug_12073.txt +++ b/test/prism/snapshots/whitequark/ruby_bug_12073.txt @@ -47,6 +47,7 @@ │ @ ParametersNode (location: (3,8)-(3,13)) │ ├── requireds: (length: 1) │ │ └── @ RequiredParameterNode (location: (3,8)-(3,13)) + │ │ ├── flags: ∅ │ │ └── name: :raise │ ├── optionals: (length: 0) │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/ruby_bug_15789.txt b/test/prism/snapshots/whitequark/ruby_bug_15789.txt index 245126d85d..d4062f8ae7 100644 --- a/test/prism/snapshots/whitequark/ruby_bug_15789.txt +++ b/test/prism/snapshots/whitequark/ruby_bug_15789.txt @@ -27,6 +27,7 @@ │ │ │ │ ├── requireds: (length: 0) │ │ │ │ ├── optionals: (length: 1) │ │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,15)) + │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ ├── name: :a │ │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" │ │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" @@ -89,6 +90,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ OptionalKeywordParameterNode (location: (3,5)-(3,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (3,5)-(3,7) = "a:" │ │ │ │ └── value: diff --git a/test/prism/snapshots/whitequark/ruby_bug_9669.txt b/test/prism/snapshots/whitequark/ruby_bug_9669.txt index 8f6d188acd..55e61cb46b 100644 --- a/test/prism/snapshots/whitequark/ruby_bug_9669.txt +++ b/test/prism/snapshots/whitequark/ruby_bug_9669.txt @@ -15,6 +15,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :b │ │ │ └── name_loc: (1,6)-(1,8) = "b:" │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/whitequark/send_lambda.txt b/test/prism/snapshots/whitequark/send_lambda.txt index 5b0aa38d3d..552645c462 100644 --- a/test/prism/snapshots/whitequark/send_lambda.txt +++ b/test/prism/snapshots/whitequark/send_lambda.txt @@ -17,6 +17,7 @@ │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: │ │ │ │ @ RestParameterNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: ∅ │ │ │ │ ├── name_loc: ∅ │ │ │ │ └── operator_loc: (1,3)-(1,4) = "*" diff --git a/test/prism/snapshots/whitequark/send_lambda_args.txt b/test/prism/snapshots/whitequark/send_lambda_args.txt index e5ca1e2ee7..30f80bd2a1 100644 --- a/test/prism/snapshots/whitequark/send_lambda_args.txt +++ b/test/prism/snapshots/whitequark/send_lambda_args.txt @@ -15,6 +15,7 @@ │ │ │ @ ParametersNode (location: (1,4)-(1,5)) │ │ │ ├── requireds: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -38,6 +39,7 @@ │ │ @ ParametersNode (location: (3,3)-(3,4)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (3,3)-(3,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ diff --git a/test/prism/snapshots/whitequark/send_lambda_args_noparen.txt b/test/prism/snapshots/whitequark/send_lambda_args_noparen.txt index b97b8647ab..a420d05f36 100644 --- a/test/prism/snapshots/whitequark/send_lambda_args_noparen.txt +++ b/test/prism/snapshots/whitequark/send_lambda_args_noparen.txt @@ -19,6 +19,7 @@ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) │ │ │ │ └── @ OptionalKeywordParameterNode (location: (1,3)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ ├── name: :a │ │ │ │ ├── name_loc: (1,3)-(1,5) = "a:" │ │ │ │ └── value: @@ -46,6 +47,7 @@ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) │ │ │ └── @ RequiredKeywordParameterNode (location: (3,3)-(3,5)) + │ │ │ ├── flags: ∅ │ │ │ ├── name: :a │ │ │ └── name_loc: (3,3)-(3,5) = "a:" │ │ ├── keyword_rest: ∅ diff --git a/test/prism/snapshots/whitequark/send_lambda_args_shadow.txt b/test/prism/snapshots/whitequark/send_lambda_args_shadow.txt index 388988b573..4a0d2fd53e 100644 --- a/test/prism/snapshots/whitequark/send_lambda_args_shadow.txt +++ b/test/prism/snapshots/whitequark/send_lambda_args_shadow.txt @@ -15,6 +15,7 @@ │ │ @ ParametersNode (location: (1,3)-(1,4)) │ │ ├── requireds: (length: 1) │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ @@ -24,8 +25,10 @@ │ │ └── block: ∅ │ ├── locals: (length: 2) │ │ ├── @ BlockLocalVariableNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :foo │ │ └── @ BlockLocalVariableNode (location: (1,11)-(1,14)) + │ │ ├── flags: ∅ │ │ └── name: :bar │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,14)-(1,15) = ")" diff --git a/test/prism/snapshots/whitequark/trailing_forward_arg.txt b/test/prism/snapshots/whitequark/trailing_forward_arg.txt index bced34e1bc..fa6036e469 100644 --- a/test/prism/snapshots/whitequark/trailing_forward_arg.txt +++ b/test/prism/snapshots/whitequark/trailing_forward_arg.txt @@ -11,8 +11,10 @@ │ @ ParametersNode (location: (1,8)-(1,17)) │ ├── requireds: (length: 2) │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: ∅ │ │ │ └── name: :a │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ ├── flags: ∅ │ │ └── name: :b │ ├── optionals: (length: 0) │ ├── rest: ∅