summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:40:06 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:40:06 +0000
commit83b3238d34a83ff2ebc4cb31a776e4855a775a84 (patch)
tree5503b50d3c829e872547f06c66523c9f7608f298
parent7b7e511246cf366fdcffb59c72556613550484cc (diff)
downloadruby-83b3238d34a83ff2ebc4cb31a776e4855a775a84.tar.gz
ruby-83b3238d34a83ff2ebc4cb31a776e4855a775a84.tar.xz
ruby-83b3238d34a83ff2ebc4cb31a776e4855a775a84.zip
merges r25405 from trunk into ruby_1_9_1. fixes the backport task #2233.
-- * parse.y (method_call): dispatch symbols. a patch from Andy Keep in [ruby-core:26169]. [ruby-core:26165] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y8
-rw-r--r--test/ripper/test_parser_events.rb22
-rw-r--r--version.h2
4 files changed, 27 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index a518290b1..e1022ef21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue Oct 20 15:07:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 20 15:28:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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]
diff --git a/parse.y b/parse.y
index 1fa248bf2..0779bc223 100644
--- a/parse.y
+++ b/parse.y
@@ -3615,8 +3615,8 @@ method_call : operation paren_args
$$ = 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);
%*/
}
@@ -3626,8 +3626,8 @@ method_call : operation paren_args
$$ = 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);
%*/
}
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index e82d37c1d..6ca81d3f0 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -202,6 +202,24 @@ class TestRipper_ParserEvents < Test::Unit::TestCase
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 @@ class TestRipper_ParserEvents < Test::Unit::TestCase
assert_equal true, $thru__break
end
- def test_call
- assert_equal true, $thru__call
- end
-
def test_case
assert_equal true, $thru__case
end
diff --git a/version.h b/version.h
index 4573304c8..4065833c5 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 366
+#define RUBY_PATCHLEVEL 367
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1