Unnamed repository; edit this file 'description' to name the repository.
Merge rust-analyzer/ungrammar#16
16: Add `MacroDef` for "Macros 2.0" r=matklad a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
bors[bot] 2020-12-16
parent 4bf31c1 · parent fe8823d · commit 9a81c80
-rw-r--r--lib/ungrammar/rust.ungram6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram
index ca3cf9292a..bfa2ade2df 100644
--- a/lib/ungrammar/rust.ungram
+++ b/lib/ungrammar/rust.ungram
@@ -90,6 +90,7 @@ Item =
| Impl
| MacroCall
| MacroRules
+| MacroDef
| Module
| Static
| Struct
@@ -103,6 +104,11 @@ MacroRules =
'macro_rules' '!' Name
TokenTree
+MacroDef =
+ Attr* Visibility?
+ 'macro' Name args:TokenTree?
+ body:TokenTree
+
Module =
Attr* Visibility?
'mod' Name