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

ruby-changes:13622

From: nobu <ko1@a...>
Date: Tue, 20 Oct 2009 15:29:07 +0900 (JST)
Subject: [ruby-changes:13622] Ruby:r25405 (trunk): * parse.y (method_call): dispatch symbols. a patch from Andy Keep in

nobu	2009-10-20 15:28:51 +0900 (Tue, 20 Oct 2009)

  New Revision: 25405

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25405

  Log:
    * parse.y (method_call): dispatch symbols.  a patch from Andy Keep in
      [ruby-core:26169].  [ruby-core:26165]

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
    trunk/test/ripper/test_parser_events.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25404)
+++ ChangeLog	(revision 25405)
@@ -1,5 +1,8 @@
-Tue Oct 20 15:07:37 2009  Nobuyoshi Nakada  <nobu@r...>
+Tue Oct 20 15:28:49 2009  Nobuyoshi Nakada  <nobu@r...>
 
+	* parse.y (method_call): dispatch symbols.  a patch from Andy Keep in
+	  [ruby-core:26169].  [ruby-core:26165]
+
 	* parse.y (mlhs_basic): fixed handling splat in middle of mlhs.  a
 	  patch from Andy Keep in [ruby-core:26163]
 
Index: parse.y
===================================================================
--- parse.y	(revision 25404)
+++ parse.y	(revision 25405)
@@ -3560,8 +3560,8 @@
 			$$ = NEW_CALL($1, rb_intern("call"), $3);
 			fixpos($$, $1);
 		    /*%
-			$$ = dispatch3(call, dispatch1(paren, $1),
-				       ripper_id2sym('.'), rb_intern("call"));
+			$$ = dispatch3(call, $1, ripper_id2sym('.'),
+				       ripper_intern("call"));
 			$$ = method_optarg($$, $3);
 		    %*/
 		    }
@@ -3571,8 +3571,8 @@
 			$$ = NEW_CALL($1, rb_intern("call"), $3);
 			fixpos($$, $1);
 		    /*%
-			$$ = dispatch3(call, dispatch1(paren, $1),
-				       ripper_id2sym('.'), rb_intern("call"));
+			$$ = dispatch3(call, $1, ripper_intern("::"),
+				       ripper_intern("call"));
 			$$ = method_optarg($$, $3);
 		    %*/
 		    }
Index: test/ripper/test_parser_events.rb
===================================================================
--- test/ripper/test_parser_events.rb	(revision 25404)
+++ test/ripper/test_parser_events.rb	(revision 25405)
@@ -202,6 +202,24 @@
     assert_equal true, thru_bodystmt
   end
 
+  def test_call
+    bug2233 = '[ruby-core:26165]'
+    tree = nil
+
+    thru_call = false
+    assert_nothing_raised {
+      tree = parse("self.foo", :on_call) {thru_call = true}
+    }
+    assert_equal true, thru_call
+    assert_equal "[call(ref(self),.,foo)]", tree
+    thru_call = false
+    assert_nothing_raised(bug2233) {
+      tree = parse("foo.()", :on_call) {thru_call = true}
+    }
+    assert_equal true, thru_call
+    assert_equal "[call(ref(foo),.,call,[])]", tree
+  end
+
   def test_heredoc
     bug1921 = '[ruby-core:24855]'
     thru_heredoc_beg = false
@@ -265,10 +283,6 @@
     assert_equal true, $thru__break
   end
 
-  def test_call
-    assert_equal true, $thru__call
-  end
-
   def test_case
     assert_equal true, $thru__case
   end

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

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