Fix the same bug as #396 but for bytes too
This commit is contained in:
@@ -88,7 +88,9 @@ fn validate_byte_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxErr
|
||||
|
||||
fn validate_byte_code_escape(text: &str, range: TextRange, errors: &mut Vec<SyntaxError>) {
|
||||
// A ByteCodeEscape has 4 chars, example: `\xDD`
|
||||
if text.len() < 4 {
|
||||
if !text.is_ascii() {
|
||||
errors.push(SyntaxError::new(MalformedByteCodeEscape, range));
|
||||
} else if text.chars().count() < 4 {
|
||||
errors.push(SyntaxError::new(TooShortByteCodeEscape, range));
|
||||
} else {
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user