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:
parent
62baad9fe1
commit
f38b3e8c70
2 changed files with 7 additions and 1 deletions
6
parse.y
6
parse.y
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue