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

ruby-changes:55100

From: nobu <ko1@a...>
Date: Tue, 19 Mar 2019 15:23:41 +0900 (JST)
Subject: [ruby-changes:55100] nobu:r67307 (trunk): parse.y: removed redundant number_arg parser event

nobu	2019-03-19 15:23:36 +0900 (Tue, 19 Mar 2019)

  New Revision: 67307

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

  Log:
    parse.y: removed redundant number_arg parser event

  Modified files:
    trunk/parse.y
    trunk/test/ripper/test_parser_events.rb
Index: parse.y
===================================================================
--- parse.y	(revision 67306)
+++ parse.y	(revision 67307)
@@ -3825,7 +3825,7 @@ string_dvar	: tGVAR https://github.com/ruby/ruby/blob/trunk/parse.y#L3825
 			$$ = NEW_DVAR(id, &@1);
 		    /*% %*/
 			(void)id;
-		    /*% ripper: var_ref!(number_arg!($1)) %*/
+		    /*% ripper: var_ref!($1) %*/
 		    }
 		| backref
 		;
@@ -3885,11 +3885,10 @@ user_variable	: tIDENTIFIER https://github.com/ruby/ruby/blob/trunk/parse.y#L3885
 		| tNUMPARAM
 		    {
 			ID id = numparam_id(p, get_num($1));
-		    /*% ripper: number_arg!($1) %*/
 		    /*%%%*/
 			$$ = id;
 		    /*%
-			$$ = ripper_new_yylval(p, id, $$, 0);
+			$$ = ripper_new_yylval(p, id, get_value($1), 0);
 		    %*/
 		    }
 		;
Index: test/ripper/test_parser_events.rb
===================================================================
--- test/ripper/test_parser_events.rb	(revision 67306)
+++ test/ripper/test_parser_events.rb	(revision 67307)
@@ -58,7 +58,7 @@ class TestRipper::ParserEvents < Test::U https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb#L58
     assert_equal '[assign(var_field(a),ref(a))]', parse('a=a')
     assert_equal '[ref(nil)]', parse('nil')
     assert_equal '[ref(true)]', parse('true')
-    assert_include parse('proc{@1}'), '[ref(number_arg(@1))]'
+    assert_include parse('proc{@1}'), '[ref(@1)]'
   end
 
   def test_vcall
@@ -813,12 +813,6 @@ class TestRipper::ParserEvents < Test::U https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb#L813
     assert_equal true, thru_next
   end
 
-  def test_number_arg
-    thru_number_arg = false
-    parse('proc {@1}', :on_number_arg) {thru_number_arg = true}
-    assert_equal true, thru_number_arg
-  end
-
   def test_opassign
     thru_opassign = false
     tree = parse('a += b', :on_opassign) {thru_opassign = true}

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

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