Skip to content

Commit

Permalink
Add visibility section of the grammar
Browse files Browse the repository at this point in the history
Namely an optional "pub" before any item. The "pub" in the Use
declaration section should use this too.
  • Loading branch information
carols10cents committed May 11, 2015
1 parent 9ecc989 commit c9c8ff1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/doc/grammar.md
Expand Up @@ -304,7 +304,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
## Items

```antlr
item : mod_item | fn_item | type_item | struct_item | enum_item
item : vis ? mod_item | fn_item | type_item | struct_item | enum_item
| const_item | static_item | trait_item | impl_item | extern_block ;
```

Expand Down Expand Up @@ -335,8 +335,8 @@ crate_name: ident | ( ident "as" ident )
##### Use declarations

```antlr
use_decl : "pub" ? "use" [ path "as" ident
| path_glob ] ;
use_decl : vis ? "use" [ path "as" ident
| path_glob ] ;
path_glob : ident [ "::" [ path_glob
| '*' ] ] ?
Expand Down Expand Up @@ -414,8 +414,9 @@ extern_block : [ foreign_fn ] * ;

## Visibility and Privacy

**FIXME:** grammar?

```antlr
vis : "pub" ;
```
### Re-exporting and Visibility

**FIXME:** grammar?
Expand Down

0 comments on commit c9c8ff1

Please sign in to comment.