mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
mbe: split Op::Leaf
and handle multi-character puncts
This commit is contained in:
parent
47c6c8e2f3
commit
ec7148b091
6 changed files with 183 additions and 56 deletions
|
@ -134,7 +134,13 @@ fn expand_subtree(
|
|||
let mut err = None;
|
||||
for op in template.iter() {
|
||||
match op {
|
||||
Op::Leaf(tt) => arena.push(tt.clone().into()),
|
||||
Op::Literal(it) => arena.push(tt::Leaf::from(it.clone()).into()),
|
||||
Op::Ident(it) => arena.push(tt::Leaf::from(it.clone()).into()),
|
||||
Op::Punct(puncts) => {
|
||||
for punct in puncts {
|
||||
arena.push(tt::Leaf::from(punct.clone()).into());
|
||||
}
|
||||
}
|
||||
Op::Subtree { tokens, delimiter } => {
|
||||
let ExpandResult { value: tt, err: e } =
|
||||
expand_subtree(ctx, tokens, *delimiter, arena);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue