mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 23:16:42 +02:00
Fix the error token on "invalid hex escape"
* parse.y (tok_hex): flush token after dispatching the "invalid hex escape" parse error.
This commit is contained in:
parent
22da5d71ea
commit
c990b3c41a
3 changed files with 12 additions and 2 deletions
|
@ -513,7 +513,7 @@ class TestParse < Test::Unit::TestCase
|
|||
mesg = 'from the backslash through the invalid char'
|
||||
|
||||
e = assert_syntax_error('"\xg1"', /hex escape/)
|
||||
assert_equal(' ^', e.message.lines.last, mesg)
|
||||
assert_equal(' ^~', e.message.lines.last, mesg)
|
||||
|
||||
e = assert_syntax_error('"\u{1234"', 'unterminated Unicode escape')
|
||||
assert_equal(' ^', e.message.lines.last, mesg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue