fix(errors): unexpected char errors were pointing one char too far

This commit is contained in:
Khaïs COLIN 2025-05-04 18:10:50 +02:00
parent a0869b1b66
commit 106c2547b5
2 changed files with 8 additions and 3 deletions

View file

@ -216,11 +216,12 @@ impl Tokenizer {
} else if c.is_whitespace() {
self.advance();
} else {
self.advance();
return Err(ScanError {
let result = Err(ScanError {
location: self.current_location(1),
kind: ScanErrorKind::UnexpectedChar(c),
});
self.advance();
return result;
}
} else {
return Ok(None);