diff --git a/parse.y b/parse.y index f746a0c272..5fae5dc218 100644 --- a/parse.y +++ b/parse.y @@ -2673,11 +2673,7 @@ rel_expr : arg relop arg %prec '>' } ; -lex_ctxt : tSP - { - $$ = p->ctxt; - } - | none +lex_ctxt : none { $$ = p->ctxt; } diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 1d756441f8..8b7c8f0e5b 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1366,6 +1366,10 @@ x = __ENCODING__ assert_valid_syntax('class while true; break Object end::Kernel; end') end + def test_escaped_space + assert_syntax_error('x = \ 42', /escaped space/) + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}