1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2016-02-15 17:41:46 +00:00
parent fbb51ff44c
commit 8b019eed78

View file

@ -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);
}