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:
parent
b51cb131bd
commit
2135027219
@ -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")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user