mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Fix up the syntax tree for macro 2.0
This commit is contained in:
parent
26c7bfd0b4
commit
013b6a883f
9 changed files with 226 additions and 169 deletions
|
@ -372,13 +372,11 @@ fn macro_def(p: &mut Parser<'_>, m: Marker) {
|
|||
// macro m { ($i:ident) => {} }
|
||||
token_tree(p);
|
||||
} else if p.at(T!['(']) {
|
||||
let m = p.start();
|
||||
token_tree(p);
|
||||
match p.current() {
|
||||
T!['{'] | T!['['] | T!['('] => token_tree(p),
|
||||
_ => p.error("expected `{`, `[`, `(`"),
|
||||
}
|
||||
m.complete(p, TOKEN_TREE);
|
||||
} else {
|
||||
p.error("unmatched `(`");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue