fix(errors): unexpected char errors were pointing one char too far
This commit is contained in:
parent
a0869b1b66
commit
106c2547b5
2 changed files with 8 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue