Collect tokens when handling :literal
matcher
An `NtLiteral` just wraps an `Expr`, so we don't need to add a new `tokens` field to an AST struct.
This commit is contained in:
parent
1823dea7df
commit
d5a04a9927
2 changed files with 10 additions and 2 deletions
|
@ -278,7 +278,7 @@ pub fn nt_to_tokenstream(nt: &Nonterminal, sess: &ParseSess, span: Span) -> Toke
|
|||
Some(tokenstream::TokenTree::token(token::Lifetime(ident.name), ident.span).into())
|
||||
}
|
||||
Nonterminal::NtTT(ref tt) => Some(tt.clone().into()),
|
||||
Nonterminal::NtExpr(ref expr) => {
|
||||
Nonterminal::NtExpr(ref expr) | Nonterminal::NtLiteral(ref expr) => {
|
||||
if expr.tokens.is_none() {
|
||||
debug!("missing tokens for expr {:?}", expr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue