summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-04 05:48:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-04 05:48:33 +0000
commit3be412834d4f09eb0c2a705073ff10b1fd0d6e93 (patch)
treebb60dc27f8b5c71e6d4374925a4568bf2fab4b1b /parse.y
parentb17a16c279f6738070d1cb2de1f2139692850028 (diff)
parse.y: reserved words as <id>
* parse.y (reswords): declare reserved words as <id> to remove extra cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 3 insertions, 11 deletions
diff --git a/parse.y b/parse.y
index 4203fb9440..1782bac173 100644
--- a/parse.y
+++ b/parse.y
@@ -836,11 +836,7 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
const struct vtable *vars;
}
-/*%%%*/
-%token
-/*%
-%token <val>
-%*/
+%token <id>
keyword_class
keyword_module
keyword_def
@@ -920,10 +916,10 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post mlhs_inner
%type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3
%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
-%type <id> f_kwrest f_label f_arg_asgn call_op call_op2
+%type <id> f_kwrest f_label f_arg_asgn call_op call_op2 reswords
/*%%%*/
/*%
-%type <val> program reswords then do
+%type <val> program then do
%*/
%token END_OF_INPUT 0 "end-of-input"
%token tUPLUS RUBY_TOKEN(UPLUS) "unary+"
@@ -1882,11 +1878,7 @@ fname : tIDENTIFIER
| reswords
{
SET_LEX_STATE(EXPR_ENDFN);
- /*%%%*/
- $$ = $<id>1;
- /*%
$$ = $1;
- %*/
}
;