Improve recovery on malformed format call
If a comma in a format call is replaced with a similar token, then we emit an error and continue parsing, instead of stopping at this point.
This commit is contained in:
parent
8ed5cb56b5
commit
3524c3ef43
13 changed files with 88 additions and 53 deletions
|
@ -1233,6 +1233,10 @@ impl<'a> Parser<'a> {
|
|||
*t == token::OpenDelim(token::Brace) || *t == token::BinOp(token::Star)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn clear_expected_tokens(&mut self) {
|
||||
self.expected_tokens.clear();
|
||||
}
|
||||
}
|
||||
|
||||
crate fn make_unclosed_delims_error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue