diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-16 18:34:31 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-16 18:34:31 +0900 |
| commit | f38b3e8c707ebdcad05aa9485cf1760640b74fbb (patch) | |
| tree | 62573eb80cb579ea0e5bd3ce2274f271d9accbc0 | |
| parent | 62baad9fe17077f8881e8512234cf55563aa9fca (diff) | |
Fixed the location of args node with numbered parameter
| -rw-r--r-- | parse.y | 6 | ||||
| -rw-r--r-- | test/ruby/test_syntax.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -11377,7 +11377,11 @@ static NODE * args_with_numbered(struct parser_params *p, NODE *args, int max_numparam) { if (max_numparam > NO_PARAM) { - if (!args) args = new_args_tail(p, 0, 0, 0, 0); + if (!args) { + YYLTYPE loc = RUBY_INIT_YYLLOC(); + args = new_args_tail(p, 0, 0, 0, 0); + nd_set_loc(args, &loc); + } args->nd_ainfo->pre_args_num = max_numparam; } return args; diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 01f3295101..b93062cf2d 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1449,6 +1449,8 @@ eom assert_valid_syntax("->{#{c};->{_1};end;_1}\n") assert_valid_syntax("->{_1;#{c};->{_1};end}\n") end + + 1.times {_1} end def test_value_expr_in_condition |
