ast: Add metadata attributes on Items

TODO: decide what other places attributes belong
This commit is contained in:
2024-02-27 23:31:49 -06:00
parent 9806e95247
commit 325498ac8b
4 changed files with 102 additions and 5 deletions

View File

@@ -8,9 +8,13 @@ Visibility = "pub"? ;
File = Item* EOI ;
Item = Visibility ItemKind ;
Attrs = ('#' '[' (Meta ',') Meta? ']')* ;
Meta = Identifier ('=' Literal | '(' (Literal ',')* Literal? ')')? ;
Item = Attrs* Visibility ItemKind ;
ItemKind = Const | Static | Module
| Function | Struct | Enum
| Function | Struct | Enum
| Alias | Impl ;