diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-23 06:49:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-23 06:49:35 +0000 |
commit | 80aa804a3372424e91bd4b01cffd4600b63bbd54 (patch) | |
tree | 6f09161f61a8fc4f23b1d349e0965ee168e35bd1 | |
parent | 5983fd75f2acec804eca36f0fe57ffd7c3bf4d71 (diff) | |
download | ruby-80aa804a3372424e91bd4b01cffd4600b63bbd54.tar.gz |
parse.y: token type by identifer ID type
* parse.y (parse_ident): leave identifier type decision (local or
const) to rb_enc_symname_type, and set the token type by ID
type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -7842,7 +7842,7 @@ parse_ident(struct parser_params *parser, int c, int cmd_state) tokadd(c); } else { - result = ISUPPER(tok()[0]) ? tCONSTANT : tIDENTIFIER; + result = tCONSTANT; /* assume provisionally */ pushback(c); } tokfix(); @@ -7909,6 +7909,7 @@ parse_ident(struct parser_params *parser, int c, int cmd_state) } ident = tokenize_ident(parser, last_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(ident)) { |