diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-26 00:56:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-26 00:56:44 +0000 |
commit | 7d6965f88d6abf0e1e9f92a58139dc56b27db07a (patch) | |
tree | cd35ad367588e1712e76fac1ab304f4412962bee /test/ruby | |
parent | c6c975ca4ed009e568ace27394f96f0e112616e6 (diff) | |
download | ruby-7d6965f88d6abf0e1e9f92a58139dc56b27db07a.tar.gz |
parse.y: brace after array literal arg
* parse.y (parser_yylex): array is another literal. set state to
END too not only ENDARG and after a literal, so that a left
brace after it should be a primary block bound to the literal,
which causes syntax error. [ruby-core:81037] [Bug #13547]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index bd93285ac4..e2b5e0146e 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -974,6 +974,10 @@ eom assert_syntax_error('m 1.0 {}', error, bug) assert_syntax_error('m :m {}', error, bug) assert_syntax_error('m :"#{m}" {}', error, bug) + assert_syntax_error('m ?x {}', error, bug) + assert_syntax_error('m %[] {}', error, bug) + assert_syntax_error('m 0..1 {}', error, bug) + assert_syntax_error('m [] {}', error, bug) end def test_return_toplevel |