Remove NtVis.
We now use invisible delimiters for expanded `vis` fragments, instead of `Token::Interpolated`.
This commit is contained in:
@@ -56,9 +56,7 @@ impl<'a> Parser<'a> {
|
||||
| NtMeta(_)
|
||||
| NtPath(_) => true,
|
||||
|
||||
NtItem(_)
|
||||
| NtBlock(_)
|
||||
| NtVis(_) => false,
|
||||
NtItem(_) | NtBlock(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +86,7 @@ impl<'a> Parser<'a> {
|
||||
NonterminalKind::Ident => get_macro_ident(token).is_some(),
|
||||
NonterminalKind::Literal => token.can_begin_literal_maybe_minus(),
|
||||
NonterminalKind::Vis => match token.kind {
|
||||
// The follow-set of :vis + "priv" keyword + interpolated
|
||||
// The follow-set of :vis + "priv" keyword + interpolated/metavar-expansion.
|
||||
token::Comma
|
||||
| token::Ident(..)
|
||||
| token::NtIdent(..)
|
||||
@@ -102,7 +100,7 @@ impl<'a> Parser<'a> {
|
||||
token::NtLifetime(..) => true,
|
||||
token::Interpolated(nt) => match &**nt {
|
||||
NtBlock(_) | NtStmt(_) | NtExpr(_) | NtLiteral(_) => true,
|
||||
NtItem(_) | NtPat(_) | NtTy(_) | NtMeta(_) | NtPath(_) | NtVis(_) => false,
|
||||
NtItem(_) | NtPat(_) | NtTy(_) | NtMeta(_) | NtPath(_) => false,
|
||||
},
|
||||
token::OpenDelim(Delimiter::Invisible(InvisibleOrigin::MetaVar(k))) => match k {
|
||||
MetaVarKind::Block
|
||||
@@ -208,8 +206,9 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
NonterminalKind::Meta => NtMeta(P(self.parse_attr_item(ForceCollect::Yes)?)),
|
||||
NonterminalKind::Vis => {
|
||||
NtVis(P(self
|
||||
.collect_tokens_no_attrs(|this| this.parse_visibility(FollowedByType::Yes))?))
|
||||
return Ok(ParseNtResult::Vis(P(self.collect_tokens_no_attrs(|this| {
|
||||
this.parse_visibility(FollowedByType::Yes)
|
||||
})?)));
|
||||
}
|
||||
NonterminalKind::Lifetime => {
|
||||
// We want to keep `'keyword` parsing, just like `keyword` is still
|
||||
|
||||
Reference in New Issue
Block a user