assign ids to tokens

This commit is contained in:
Aleksey Kladov 2019-02-11 19:28:39 +03:00
parent b356ab46f2
commit 58897dd8dd
4 changed files with 15 additions and 3 deletions

View file

@ -3,6 +3,7 @@
/// `tt::TokenTree` for the result of the expansion.
use rustc_hash::FxHashMap;
use ra_syntax::SmolStr;
use tt::TokenId;
use crate::tt_cursor::TtCursor;
@ -185,7 +186,8 @@ fn expand_tt(
}
crate::TokenTree::Leaf(leaf) => match leaf {
crate::Leaf::Ident(ident) => {
tt::Leaf::from(tt::Ident { text: ident.text.clone() }).into()
tt::Leaf::from(tt::Ident { text: ident.text.clone(), id: TokenId::unspecified() })
.into()
}
crate::Leaf::Punct(punct) => tt::Leaf::from(punct.clone()).into(),
crate::Leaf::Var(v) => bindings.get(&v.text, nesting)?.clone(),