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:
Nobuyoshi Nakada 2019-06-03 14:56:42 +09:00
parent 22da5d71ea
commit c990b3c41a
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
3 changed files with 12 additions and 2 deletions

View file

@ -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)