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
|
@ -141,7 +141,13 @@ fn invocation_fixtures(rules: &FxHashMap<String, DeclarativeMacro>) -> Vec<(Stri
|
|||
None => (),
|
||||
Some(kind) => panic!("Unhandled kind {kind:?}"),
|
||||
},
|
||||
Op::Leaf(leaf) => parent.token_trees.push(leaf.clone().into()),
|
||||
Op::Literal(it) => parent.token_trees.push(tt::Leaf::from(it.clone()).into()),
|
||||
Op::Ident(it) => parent.token_trees.push(tt::Leaf::from(it.clone()).into()),
|
||||
Op::Punct(puncts) => {
|
||||
for punct in puncts {
|
||||
parent.token_trees.push(tt::Leaf::from(punct.clone()).into());
|
||||
}
|
||||
}
|
||||
Op::Repeat { tokens, kind, separator } => {
|
||||
let max = 10;
|
||||
let cnt = match kind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue