summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-15 17:41:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-15 17:41:46 +0000
commit8b019eed78fbf8e66e25bc9b1bf753204cea9b0f (patch)
tree58991cd3a91bba3d1aa7286c091c6e57c0a6951d
parentfbb51ff44cef3a28658285783b810acc8cbae048 (diff)
parse.y: short circuit by result
* parse.y (parse_ident): short circuit by result, as only tIDENTIFIER can be a local variable, but tFID and tCONSTANT not. fix up r53834. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index b8d5e6c..49833e0 100644
--- a/parse.y
+++ b/parse.y
@@ -8072,6 +8072,7 @@ parse_ident(struct parser_params *parser, int c, int cmd_state)
ident = tokenize_ident(parser, last_state);
if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
+ (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
lvar_defined(ident)) {
SET_LEX_STATE(EXPR_END|EXPR_LABEL);
}