mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
parse.y: insane syntax
* parse.y (primary): save/restore COND and CMDARG stacks at method definition, to distinguish do_block and do_cond properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d68a3d3bc1
commit
9c2c2f77ba
2 changed files with 31 additions and 8 deletions
|
@ -1181,6 +1181,11 @@ eom
|
|||
assert_equal(line, e.backtrace_locations[0].lineno)
|
||||
end
|
||||
|
||||
def test_methoddef_in_cond
|
||||
assert_valid_syntax('while def foo; tap do end; end; break; end')
|
||||
assert_valid_syntax('while def foo a = tap do end; end; break; end')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def not_label(x) @result = x; @not_label ||= nil end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue