Add warning when whitespace is not skipped after an escaped newline.

This commit is contained in:
Anton Golov 2021-07-30 16:09:33 +02:00
parent 1195bea5a7
commit 5d59b4412e
4 changed files with 75 additions and 8 deletions

View file

@ -253,6 +253,12 @@ pub(crate) fn emit_unescape_error(
let msg = "invalid trailing slash in literal";
handler.struct_span_err(span, msg).span_label(span, msg).emit();
}
EscapeError::UnskippedWhitespaceWarning => {
let (c, char_span) = last_char();
let msg =
format!("non-ASCII whitespace symbol '{}' is not skipped", c.escape_unicode());
handler.struct_span_warn(span, &msg).span_label(char_span, &msg).emit();
}
}
}