1
Fork 0

fix(lexer): not skipped whitespace warning for '\x0c'

This commit is contained in:
bohan 2023-03-09 22:42:06 +08:00
parent 9b60e6c68f
commit d223c26bce
4 changed files with 40 additions and 10 deletions

View file

@ -298,10 +298,10 @@ where
}
let tail = &tail[first_non_space..];
if let Some(c) = tail.chars().nth(0) {
// For error reporting, we would like the span to contain the character that was not
// skipped. The +1 is necessary to account for the leading \ that started the escape.
let end = start + first_non_space + c.len_utf8() + 1;
if c.is_whitespace() {
// For error reporting, we would like the span to contain the character that was not
// skipped. The +1 is necessary to account for the leading \ that started the escape.
let end = start + first_non_space + c.len_utf8() + 1;
callback(start..end, Err(EscapeError::UnskippedWhitespaceWarning));
}
}