diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-12-26 10:55:22 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-01-21 16:27:26 +0200 |
| commit | 838b2ea760282c716f4354b40fafe3cd55ae5ec7 (patch) | |
| tree | c16625a087ba4c803be0894fbaea1ed6f449b89b /src/doc | |
| parent | 3102b9e19e7af6f133777e4281d7d4e4d82fe4b0 (diff) | |
| download | rust-838b2ea760282c716f4354b40fafe3cd55ae5ec7.tar.gz rust-838b2ea760282c716f4354b40fafe3cd55ae5ec7.zip | |
docs: fix fallout of merging ast::ViewItem into ast::Item.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/reference.md | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index d3af4ab1c74..8f76e2a1f3d 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -803,8 +803,9 @@ Crates contain [items](#items), each of which may have some number of ## Items ```{.ebnf .gram} -item : mod_item | fn_item | type_item | struct_item | enum_item - | static_item | trait_item | impl_item | extern_block ; +item : extern_crate_decl | use_decl | mod_item | fn_item | type_item + | struct_item | enum_item | static_item | trait_item | impl_item + | extern_block ; ``` An _item_ is a component of a crate; some module items can be defined in crate @@ -818,6 +819,8 @@ execution, and may reside in read-only memory. There are several kinds of item: +* [`extern crate` declarations](#extern-crate-declarations) +* [`use` declarations](#use-declarations) * [modules](#modules) * [functions](#functions) * [type definitions](#type-definitions) @@ -854,13 +857,10 @@ no notion of type abstraction: there are no first-class "forall" types. ```{.ebnf .gram} mod_item : "mod" ident ( ';' | '{' mod '}' ); -mod : [ view_item | item ] * ; +mod : item * ; ``` -A module is a container for zero or more [view items](#view-items) and zero or -more [items](#items). The view items manage the visibility of the items defined -within the module, as well as the visibility of names from outside the module -when referenced from inside the module. +A module is a container for zero or more [items](#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 @@ -918,19 +918,6 @@ mod thread { } ``` -#### View items - -```{.ebnf .gram} -view_item : extern_crate_decl | use_decl ; -``` - -A view item manages the namespace of a module. View items do not define new -items, but rather, simply change other items' visibility. There are two -kinds of view items: - -* [`extern crate` declarations](#extern-crate-declarations) -* [`use` declarations](#use-declarations) - ##### Extern crate declarations ```{.ebnf .gram} @@ -2891,13 +2878,12 @@ Point3d {y: 0, z: 10, .. base}; ### Block expressions ```{.ebnf .gram} -block_expr : '{' [ view_item ] * - [ stmt ';' | item ] * +block_expr : '{' [ stmt ';' | item ] * [ expr ] '}' ; ``` A _block expression_ is similar to a module in terms of the declarations that -are possible. Each block conceptually introduces a new namespace scope. View +are possible. Each block conceptually introduces a new namespace scope. Use items can bring new names into scopes and declared items are in scope for only the block itself. |
