Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--lib/ungrammar/rust.ungram11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram
index d8950d2deb..1d8769fe84 100644
--- a/lib/ungrammar/rust.ungram
+++ b/lib/ungrammar/rust.ungram
@@ -58,7 +58,7 @@ ConstArg =
Expr
MacroCall =
- Attr* Path '!' Name? TokenTree ';'?
+ Attr* Path '!' TokenTree ';'?
TokenTree =
'(' ')'
@@ -89,6 +89,7 @@ Item =
| Fn
| Impl
| MacroCall
+| MacroRules
| Module
| Static
| Struct
@@ -97,6 +98,14 @@ Item =
| Union
| Use
+MacroRules =
+ Attr* Visibility?
+ 'macro_rules' '!' Name
+ '{' MacroArm (';' MacroArm)* ';'? '}'
+
+MacroArm =
+ TokenTree '=>' TokenTree
+
Module =
Attr* Visibility?
'mod' Name