diff --git a/parse.y b/parse.y index 7c51806ab7..8a53a40309 100644 --- a/parse.y +++ b/parse.y @@ -500,6 +500,7 @@ static VALUE ripper_get_value(VALUE); #define get_value(val) ripper_get_value(val) static VALUE assignable(struct parser_params*,VALUE); static int id_is_var(struct parser_params *p, ID id); +static bool parser_numbered_param(struct parser_params *p, unsigned long n); #define method_cond(p,node,loc) (node) #define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1)) @@ -3899,7 +3900,7 @@ var_ref : user_variable /*%%%*/ if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$); /*% - if (id_is_var(p, get_id($1))) { + if (parser_numbered_param(p, $1) || id_is_var(p, get_id($1))) { $$ = dispatch1(var_ref, $1); } else {