mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
assign ids to tokens
This commit is contained in:
parent
b356ab46f2
commit
58897dd8dd
4 changed files with 15 additions and 3 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue