mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Fix macro_rules not accepting brackets or parentheses
This commit is contained in:
parent
fd1fcf2c2e
commit
3e0bb89541
3 changed files with 66 additions and 2 deletions
|
@ -389,10 +389,15 @@ fn macro_rules(p: &mut Parser, m: Marker) {
|
|||
}
|
||||
|
||||
match p.current() {
|
||||
T!['{'] => {
|
||||
// test macro_rules_non_brace
|
||||
// macro_rules! m ( ($i:ident) => {} );
|
||||
// macro_rules! m [ ($i:ident) => {} ];
|
||||
T!['['] | T!['('] => {
|
||||
token_tree(p);
|
||||
p.expect(T![;]);
|
||||
}
|
||||
_ => p.error("expected `{`"),
|
||||
T!['{'] => token_tree(p),
|
||||
_ => p.error("expected `{`, `[`, `(`"),
|
||||
}
|
||||
m.complete(p, MACRO_RULES);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue