fix(parse): return unpected when current token is EOF
This commit is contained in:
parent
077fc26f0a
commit
272dc5a6d5
3 changed files with 13 additions and 1 deletions
|
@ -536,7 +536,9 @@ impl<'a> Parser<'a> {
|
|||
} else if inedible.contains(&self.token.kind) {
|
||||
// leave it in the input
|
||||
Ok(false)
|
||||
} else if self.last_unexpected_token_span == Some(self.token.span) {
|
||||
} else if self.token.kind != token::Eof
|
||||
&& self.last_unexpected_token_span == Some(self.token.span)
|
||||
{
|
||||
FatalError.raise();
|
||||
} else {
|
||||
self.expected_one_of_not_found(edible, inedible)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue