diff options
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -8374,7 +8374,7 @@ parser_yylex(struct parser_params *parser) if (c == ')') SET_LEX_STATE(EXPR_ENDFN); else - SET_LEX_STATE(EXPR_ENDARG); + SET_LEX_STATE(EXPR_END); if (c == '}') { if (!brace_nest--) c = tSTRING_DEND; } 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 |