Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules grammar #143

Merged
merged 1 commit into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/items/modules.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Modules

A module is a container for zero or more [items].
> **<sup>Syntax:<sup>**
> _Module_ :
> &nbsp;&nbsp; &nbsp;&nbsp; `mod` [IDENTIFIER] `;`
> &nbsp;&nbsp; | `mod` [IDENTIFIER] `{`
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [_Item_]<sup>\*</sup>
> &nbsp;&nbsp; &nbsp;&nbsp; `}`

[items]: items.html
A module is a container for zero or more [items].

A _module item_ is a module, surrounded in braces, named, and prefixed with the
keyword `mod`. A module item introduces a new, named module into the tree of
Expand Down Expand Up @@ -61,3 +67,11 @@ mod thread {
mod local_data;
}
```

[IDENTIFIER]: identifiers.html

[_InnerAttribute_]: attributes.html
[_OuterAttribute_]: attributes.html

[_Item_]: items.html
[items]: items.html