Add flag to forbid recovery in the parser
This commit is contained in:
parent
85d089b41e
commit
ed14202864
3 changed files with 24 additions and 2 deletions
|
@ -2112,6 +2112,8 @@ impl<'a> Parser<'a> {
|
|||
// HACK: This is needed so we can detect whether we're inside a macro,
|
||||
// where regular assumptions about what tokens can follow other tokens
|
||||
// don't necessarily apply.
|
||||
&& self.may_recover()
|
||||
// FIXME(Nilstrieb): Remove this check once `may_recover` actually stops recovery
|
||||
&& self.subparser_name.is_none()
|
||||
{
|
||||
// It is likely that the closure body is a block but where the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue