Skip to content

Commit 154e392

Browse files
committed
Modules grammar
1 parent 7bfc70e commit 154e392

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/items/modules.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Modules
22

3-
A module is a container for zero or more [items].
3+
> **<sup>Syntax:<sup>**
4+
> _Module_ :
5+
> &nbsp;&nbsp; &nbsp;&nbsp; `mod` [IDENTIFIER] `;`
6+
> &nbsp;&nbsp; | `mod` [IDENTIFIER] `{`
7+
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>
8+
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [_Item_]<sup>\*</sup>
9+
> &nbsp;&nbsp; &nbsp;&nbsp; `}`
410
5-
[items]: items.html
11+
A module is a container for zero or more [items].
612

713
A _module item_ is a module, surrounded in braces, named, and prefixed with the
814
keyword `mod`. A module item introduces a new, named module into the tree of
@@ -61,3 +67,11 @@ mod thread {
6167
mod local_data;
6268
}
6369
```
70+
71+
[IDENTIFIER]: identifiers.html
72+
73+
[_InnerAttribute_]: attributes.html
74+
[_OuterAttribute_]: attributes.html
75+
76+
[_Item_]: items.html
77+
[items]: items.html

0 commit comments

Comments
 (0)