Improve error message in lexer (#242)

In the error message for an invalid character, print which character
triggered the error.
This commit is contained in:
Greg Shuflin 2023-04-18 02:14:18 -07:00 committed by GitHub
parent b51cb131bd
commit 2135027219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -512,7 +512,7 @@ impl Lexer<'_> {
c if is_id_start(c) => self.ident(start), c if is_id_start(c) => self.ident(start),
_ => self.error("this character is not valid in code"), c => self.error(eco_format!("the character `{c}` is not valid in code")),
} }
} }