[Bug #19025] Numbered parameter names are always local variables
This commit is contained in:
parent
bdaa491565
commit
91c004885f
Notes:
git
2023-05-14 14:24:46 +00:00
2
parse.y
2
parse.y
@ -9749,7 +9749,7 @@ parse_ident(struct parser_params *p, int c, int cmd_state)
|
||||
if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
|
||||
if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
|
||||
(result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
|
||||
lvar_defined(p, ident)) {
|
||||
(lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
|
||||
SET_LEX_STATE(EXPR_END|EXPR_LABEL);
|
||||
}
|
||||
return result;
|
||||
|
@ -1672,6 +1672,7 @@ eom
|
||||
}
|
||||
|
||||
assert_valid_syntax("proc {def foo(_);end;_1}")
|
||||
assert_valid_syntax("p { [_1 **2] }")
|
||||
end
|
||||
|
||||
def test_value_expr_in_condition
|
||||
|
Loading…
x
Reference in New Issue
Block a user