summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-14 22:16:15 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-14 22:16:15 +0900
commit91c004885fc75a93cadf0094fa86ec3bd0ec25f5 (patch)
treee759ddd8c8c6c116e5fda7ac0b13329aaaa0ea5d /parse.y
parentbdaa491565e31e3615d5da61551e08c7868db272 (diff)
downloadruby-91c004885fc75a93cadf0094fa86ec3bd0ec25f5.tar.gz
[Bug #19025] Numbered parameter names are always local variables
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index d12e8c6e73..b331174a1a 100644
--- a/parse.y
+++ b/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;