Rollup merge of #36669 - jseyfried:refactor_tok_result, r=nrc
Unify `TokResult` and `ResultAnyMacro` Fixes #36641. r? @nrc
This commit is contained in:
commit
5cc9fb9ed9
4 changed files with 102 additions and 279 deletions
|
@ -6141,15 +6141,4 @@ impl<'a> Parser<'a> {
|
|||
_ => Err(self.fatal("expected string literal"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ensure_complete_parse<F>(&mut self, allow_semi: bool, on_err: F)
|
||||
where F: FnOnce(&Parser)
|
||||
{
|
||||
if allow_semi && self.token == token::Semi {
|
||||
self.bump();
|
||||
}
|
||||
if self.token != token::Eof {
|
||||
on_err(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue