mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
parse.y: refine invalid Unicode escape message
* parse.y (literal_flush): rename from numeric_literal_flush, as it is not just for numerics now. * parse.y (parser_tokadd_codepoint): show invalid character position, but not the start of Unicode escape. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
26888a8ee7
commit
b17efb6874
2 changed files with 13 additions and 11 deletions
|
@ -490,7 +490,10 @@ class TestParse < Test::Unit::TestCase
|
|||
assert_equal(' ^', e.message.lines.last, mesg)
|
||||
|
||||
e = assert_syntax_error('"\u{1234"', 'Unicode escape')
|
||||
assert_match(' ^~~~~~~', e.message.lines.last, mesg)
|
||||
assert_match(' ^', e.message.lines.last, mesg)
|
||||
|
||||
e = assert_syntax_error('"\u{xxxx}"', 'invalid Unicode escape')
|
||||
assert_match(' ^', e.message.lines.last, mesg)
|
||||
|
||||
e = assert_syntax_error('"\M1"', /escape character syntax/)
|
||||
assert_equal(' ^~~', e.message.lines.last, mesg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue