Fix up the syntax tree for macro 2.0

This commit is contained in:
Lukas Wirth 2024-07-03 10:41:19 +02:00
parent 26c7bfd0b4
commit 013b6a883f
9 changed files with 226 additions and 169 deletions

View file

@ -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 `(`");
}