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

ruby-changes:48599

From: yui-knk <ko1@a...>
Date: Wed, 8 Nov 2017 09:03:13 +0900 (JST)
Subject: [ruby-changes:48599] yui-knk:r60714 (trunk): Omit first argument of NEW_CASE2

yui-knk	2017-11-08 09:03:02 +0900 (Wed, 08 Nov 2017)

  New Revision: 60714

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

  Log:
    Omit first argument of NEW_CASE2
    
    * node.h (NEW_CASE2): Omit first argument of NEW_CASE2,
      bacause the first argument of NEW_CASE2 is always 0.
    * parse.y: Ditto

  Modified files:
    trunk/node.h
    trunk/parse.y
Index: node.h
===================================================================
--- node.h	(revision 60713)
+++ node.h	(revision 60714)
@@ -360,7 +360,7 @@ typedef struct RNode { https://github.com/ruby/ruby/blob/trunk/node.h#L360
 #define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
 #define NEW_UNLESS(c,t,e) NEW_NODE(NODE_UNLESS,c,t,e)
 #define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0)
-#define NEW_CASE2(h,b) NEW_NODE(NODE_CASE2,h,b,0)
+#define NEW_CASE2(b) NEW_NODE(NODE_CASE2,0,b,0)
 #define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e)
 #define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
 #define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
Index: parse.y
===================================================================
--- parse.y	(revision 60713)
+++ parse.y	(revision 60714)
@@ -2911,7 +2911,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2911
 		| k_case opt_terms case_body k_end
 		    {
 		    /*%%%*/
-			$$ = NEW_CASE2(0, $3);
+			$$ = NEW_CASE2($3);
 			nd_set_line($3, $<num>1);
 			nd_set_lineno($$, @1.first_line);
 			nd_set_column($$, @1.first_column);

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

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