diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-18 01:30:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-18 01:30:37 +0000 |
commit | 676c01bb36d39cf1c0085c4853c9dcbd3b908f35 (patch) | |
tree | ae8cb959031fdd737cdac5ae498d43fe9dfa5dba /parse.y | |
parent | 849c4eaaf3a03e98ee1f7aefbf58ec152585e4df (diff) |
parse.y: fail if yyerror
* parse.y (assignable_gen): fail if yyerror occurred. fix a bug in
r36973.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -8468,25 +8468,25 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val) switch (id) { case keyword_self: yyerror("Can't change the value of self"); - break; + goto error; case keyword_nil: yyerror("Can't assign to nil"); - break; + goto error; case keyword_true: yyerror("Can't assign to true"); - break; + goto error; case keyword_false: yyerror("Can't assign to false"); - break; + goto error; case keyword__FILE__: yyerror("Can't assign to __FILE__"); - break; + goto error; case keyword__LINE__: yyerror("Can't assign to __LINE__"); - break; + goto error; case keyword__ENCODING__: yyerror("Can't assign to __ENCODING__"); - break; + goto error; } switch (id_type(id)) { case ID_LOCAL: @@ -8526,6 +8526,7 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val) default: compile_error(PARSER_ARG "identifier %s is not valid to set", rb_id2name(id)); } + error: return assignable_result(0); #undef assignable_result #undef parser_yyerror |