Fixed the location of args node with numbered parameter

This commit is contained in:
Nobuyoshi Nakada 2020-01-16 18:34:31 +09:00
Родитель 62baad9fe1
Коммит f38b3e8c70
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4BC7D6DF58D8DF60
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

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