1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fixed the location of args node with numbered parameter

This commit is contained in:
Nobuyoshi Nakada 2020-01-16 18:34:31 +09:00
parent 62baad9fe1
commit f38b3e8c70
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 7 additions and 1 deletions

View file

@ -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;

View file

@ -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