mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 10:12:21 +03:00
fixes #995
This commit is contained in:
parent
eaadb29448
commit
ecff3d6f2b
@ -299,7 +299,11 @@ impl Token {
|
||||
if input[i] == b'x' {
|
||||
hex = true;
|
||||
} else if input[i] == b'u' {
|
||||
unicode = true;
|
||||
if input[i + 1] == b'{' {
|
||||
unicode = true;
|
||||
} else {
|
||||
return (0, None);
|
||||
}
|
||||
} else {
|
||||
escaped = true;
|
||||
}
|
||||
|
@ -9,4 +9,9 @@ outputs:
|
||||
- " --> test:1:1\n |\n 1 | 'abcdefg'\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\t\\t'\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u{bbbbb}\\u{aaaa}'\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u123'\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u1' // panic\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u00000000' // should error\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u01000000' // should error\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '\\u9999999' // should error\n | ^\n |\n = unexpected token: '''"
|
||||
- " --> test:1:1\n |\n 1 | '😭😂😘'\n | ^\n |\n = unexpected token: '''"
|
||||
|
@ -17,4 +17,11 @@ expectation: Fail
|
||||
|
||||
'\u{bbbbb}\u{aaaa}'
|
||||
|
||||
'😭😂😘'
|
||||
'\u123'
|
||||
|
||||
'\u1' // should error
|
||||
'\u00000000' // should error
|
||||
'\u01000000' // should error
|
||||
'\u9999999' // should error
|
||||
|
||||
'😭😂😘'
|
||||
|
Loading…
Reference in New Issue
Block a user