1
Fork 0

Rollup merge of #36669 - jseyfried:refactor_tok_result, r=nrc

Unify `TokResult` and `ResultAnyMacro`

Fixes #36641.
r? @nrc
This commit is contained in:
Jonathan Turner 2016-09-26 17:29:48 -07:00 committed by GitHub
commit 5cc9fb9ed9
4 changed files with 102 additions and 279 deletions

View file

@ -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);
}
}
}