зеркало из https://github.com/github/ruby.git
* parse.y (method_call): dispatch symbols. a patch from Andy Keep in
[ruby-core:26169]. [ruby-core:26165] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
14f13abb85
Коммит
e3e93bb53e
|
@ -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]
|
||||
|
|
8
parse.y
8
parse.y
|
@ -3560,8 +3560,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);
|
||||
%*/
|
||||
}
|
||||
|
@ -3571,8 +3571,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);
|
||||
%*/
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче