[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
6
parse.y
6
parse.y
@ -2673,11 +2673,7 @@ rel_expr : arg relop arg %prec '>'
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
lex_ctxt : tSP
|
lex_ctxt : none
|
||||||
{
|
|
||||||
$$ = p->ctxt;
|
|
||||||
}
|
|
||||||
| none
|
|
||||||
{
|
{
|
||||||
$$ = p->ctxt;
|
$$ = p->ctxt;
|
||||||
}
|
}
|
||||||
|
@ -1366,6 +1366,10 @@ x = __ENCODING__
|
|||||||
assert_valid_syntax('class while true; break Object end::Kernel; end')
|
assert_valid_syntax('class while true; break Object end::Kernel; end')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_escaped_space
|
||||||
|
assert_syntax_error('x = \ 42', /escaped space/)
|
||||||
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
def test_past_scope_variable
|
def test_past_scope_variable
|
||||||
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}
|
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user