1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (parser_yylex): abandoned EXPR_VCALL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-21 02:31:40 +00:00
parent 8a269f85a0
commit f8e51f7e59
3 changed files with 15 additions and 35 deletions

View file

@ -823,28 +823,4 @@ x = __ENCODING__
c.instance_eval { remove_class_variable(:@var) }
end
end
def result(arg = nil, &pro)
pro || arg
end
def test_method_and_lvar
result = nil
bug3163 = '[ruby-core:29578]'
assert_equal(%[bug3163], (result %[bug3163]), bug3163)
assert_equal(/bug3163/x, (result /bug3163/x), bug3163)
pro = proc {}
assert_equal(pro, (result &pro), bug3163)
assert_equal(bug3163, (result *bug3163), bug3163)
f = g = nil
assert_raise(SyntaxError, bug3163) {eval("result ?f : g")}
assert_equal("123\n", eval("result <<FOO\n123\nFOO"), bug3163)
bug3163_2 = '[ruby-core:29594]'
one = 1
assert_equal(+1, (result +one), bug3163_2)
assert_equal(-1, (result -one), bug3163_2)
assert_equal({:a => 1}, (result a: 1))
end
end