diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 17:59:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 17:59:25 +0000 |
commit | a0f667c33e24928374d494c9c33d0082355785e1 (patch) | |
tree | f1e4e259575e14acdb5bc238fdb5a2ac1f5d66eb | |
parent | 1a7825686111ac49e2a8ef020e0eceb4f8f4258d (diff) | |
download | ruby-a0f667c33e24928374d494c9c33d0082355785e1.tar.gz |
* parse.y (assignable_gen): get rid of macro collision.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 49 |
2 files changed, 28 insertions, 25 deletions
@@ -1,3 +1,7 @@ +Sat Oct 3 02:59:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (assignable_gen): get rid of macro collision. + Sat Oct 3 02:49:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * array.c (ary_make_shared): should count frozen array itself. @@ -8013,77 +8013,76 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val) { #ifdef RIPPER ID id = get_id(lhs); -# define RETURN(x) return get_value(lhs) -# define ERROR(x) dispatch1(assign_error, lhs) +# define assignable_result(x) get_value(lhs) +# define parser_yyerror(x) dispatch1(assign_error, lhs) #else -# define RETURN(x) return x -# define ERROR(x) yyerror(x) +# define assignable_result(x) x #endif - if (!id) RETURN(0); + if (!id) return assignable_result(0); if (id == keyword_self) { - ERROR("Can't change the value of self"); + yyerror("Can't change the value of self"); } else if (id == keyword_nil) { - ERROR("Can't assign to nil"); + yyerror("Can't assign to nil"); } else if (id == keyword_true) { - ERROR("Can't assign to true"); + yyerror("Can't assign to true"); } else if (id == keyword_false) { - ERROR("Can't assign to false"); + yyerror("Can't assign to false"); } else if (id == keyword__FILE__) { - ERROR("Can't assign to __FILE__"); + yyerror("Can't assign to __FILE__"); } else if (id == keyword__LINE__) { - ERROR("Can't assign to __LINE__"); + yyerror("Can't assign to __LINE__"); } else if (id == keyword__ENCODING__) { - ERROR("Can't assign to __ENCODING__"); + yyerror("Can't assign to __ENCODING__"); } else if (is_local_id(id)) { if (dyna_in_block()) { if (dvar_curr(id)) { - RETURN(NEW_DASGN_CURR(id, val)); + return assignable_result(NEW_DASGN_CURR(id, val)); } else if (dvar_defined(id)) { - RETURN(NEW_DASGN(id, val)); + return assignable_result(NEW_DASGN(id, val)); } else if (local_id(id)) { - RETURN(NEW_LASGN(id, val)); + return assignable_result(NEW_LASGN(id, val)); } else { dyna_var(id); - RETURN(NEW_DASGN_CURR(id, val)); + return assignable_result(NEW_DASGN_CURR(id, val)); } } else { if (!local_id(id)) { local_var(id); } - RETURN(NEW_LASGN(id, val)); + return assignable_result(NEW_LASGN(id, val)); } } else if (is_global_id(id)) { - RETURN(NEW_GASGN(id, val)); + return assignable_result(NEW_GASGN(id, val)); } else if (is_instance_id(id)) { - RETURN(NEW_IASGN(id, val)); + return assignable_result(NEW_IASGN(id, val)); } else if (is_const_id(id)) { if (!in_def && !in_single) - RETURN(NEW_CDECL(id, val, 0)); - ERROR("dynamic constant assignment"); + return assignable_result(NEW_CDECL(id, val, 0)); + yyerror("dynamic constant assignment"); } else if (is_class_id(id)) { - RETURN(NEW_CVASGN(id, val)); + return assignable_result(NEW_CVASGN(id, val)); } else { compile_error(PARSER_ARG "identifier %s is not valid to set", rb_id2name(id)); } - RETURN(0); -#undef RETURN -#undef ERROR + return assignable_result(0); +#undef assignable_result +#undef parser_yyerror } static ID |