1
Fork 0

Fix tests

This commit is contained in:
Matt Peterson 2017-12-20 17:22:37 -05:00
parent 0e53360af6
commit ce76b1a1f3
2 changed files with 27 additions and 9 deletions

View file

@ -251,7 +251,7 @@ impl Token {
Lt | BinOp(Shl) | // associated path
ModSep => true, // global path
Interpolated(ref nt) => match nt.0 {
NtIdent(..) | NtTy(..) | NtPath(..) => true,
NtIdent(..) | NtTy(..) | NtPath(..) | NtLifetime(..) => true,
_ => false,
},
_ => false,
@ -318,7 +318,11 @@ impl Token {
pub fn is_lifetime(&self) -> bool {
match *self {
Lifetime(..) => true,
_ => false,
Interpolated(ref nt) => match nt.0 {
NtLifetime(..) => true,
_ => false,
},
_ => false,
}
}
@ -486,6 +490,10 @@ impl Token {
let token = Token::Ident(ident.node);
tokens = Some(TokenTree::Token(ident.span, token).into());
}
Nonterminal::NtLifetime(lifetime) => {
let token = Token::Lifetime(lifetime.ident);
tokens = Some(TokenTree::Token(lifetime.span, token).into());
}
Nonterminal::NtTT(ref tt) => {
tokens = Some(tt.clone().into());
}