diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-08 07:01:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-08 07:01:10 +0000 |
commit | 65accad30a056321856765fcac35655afbd9f44e (patch) | |
tree | fb4542d5874f92d54d4fcd9ba416fccc280e87a4 /parse.y | |
parent | 7defa3836a6dfd45e92b9a9e32f17c8246f80e21 (diff) |
parse.y: expand is_asgn_or_id
* parse.y (new_op_assign_gen): expand is_asgn_or_id(), which call
id_type() function multiple times now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -63,11 +63,6 @@ static inline int id_type(ID); #define is_class_id(id) (id_type(id)==ID_CLASS) #define is_junk_id(id) (id_type(id)==ID_JUNK) -#define is_asgn_or_id(id) ((is_notop_id(id)) && \ - ((id_type(id)) == ID_GLOBAL || \ - (id_type(id)) == ID_INSTANCE || \ - (id_type(id)) == ID_CLASS)) - enum lex_state_bits { EXPR_BEG_bit, /* ignore newline, +/- is a sign. */ EXPR_END_bit, /* newline significant, +/- is an operator. */ @@ -9610,8 +9605,13 @@ new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs) if (op == tOROP) { lhs->nd_value = rhs; asgn = NEW_OP_ASGN_OR(gettable(vid), lhs); - if (is_asgn_or_id(vid)) { - asgn->nd_aid = vid; + if (is_notop_id(vid)) { + switch (id_type(vid)) { + case ID_GLOBAL: + case ID_INSTANCE: + case ID_CLASS: + asgn->nd_aid = vid; + } } } else if (op == tANDOP) { |