[前][次][番号順一覧][スレッド一覧]

ruby-changes:48001

From: nobu <ko1@a...>
Date: Wed, 4 Oct 2017 14:48:39 +0900 (JST)
Subject: [ruby-changes:48001] nobu:r60115 (trunk): parse.y: reserved words as <id>

nobu	2017-10-04 14:48:33 +0900 (Wed, 04 Oct 2017)

  New Revision: 60115

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60115

  Log:
    parse.y: reserved words as <id>
    
    * parse.y (reswords): declare reserved words as <id> to remove
      extra cast.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60114)
+++ parse.y	(revision 60115)
@@ -836,11 +836,7 @@ static void token_info_pop_gen(struct pa https://github.com/ruby/ruby/blob/trunk/parse.y#L836
     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 pa https://github.com/ruby/ruby/blob/trunk/parse.y#L916
 %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 https://github.com/ruby/ruby/blob/trunk/parse.y#L1878
 		| reswords
 		    {
 			SET_LEX_STATE(EXPR_ENDFN);
-		    /*%%%*/
-			$$ = $<id>1;
-		    /*%
 			$$ = $1;
-		    %*/
 		    }
 		;
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]