mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[Bug #18877] Let lex_ctxt
not to eat escaped whitespace
This commit is contained in:
parent
4b1f337ef2
commit
982cda9a3e
Notes:
git
2022-06-30 16:32:10 +09:00
2 changed files with 5 additions and 5 deletions
6
parse.y
6
parse.y
|
@ -2673,11 +2673,7 @@ rel_expr : arg relop arg %prec '>'
|
|||
}
|
||||
;
|
||||
|
||||
lex_ctxt : tSP
|
||||
{
|
||||
$$ = p->ctxt;
|
||||
}
|
||||
| none
|
||||
lex_ctxt : none
|
||||
{
|
||||
$$ = p->ctxt;
|
||||
}
|
||||
|
|
|
@ -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")}}
|
||||
|
|
Loading…
Reference in a new issue