refactor(tazjin/rlox): Thread through scanner errors

... and show them to users, very crudely.

Change-Id: If4491b14db1124313f6ab7e5fbfdce9fea501d11
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2193
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2020-11-28 18:20:10 +01:00 committed by tazjin
parent af793325c0
commit 36cf7bef24
3 changed files with 29 additions and 9 deletions

View file

@ -10,6 +10,6 @@ pub struct Error {
pub kind: ErrorKind,
}
pub fn report(loc: &str, err: &Error) {
eprintln!("[line {}] Error {}: {:?}", err.line, loc, err.kind);
pub fn report(err: &Error) {
eprintln!("[line {}] Error: {:?}", err.line, err.kind);
}