Skip to content

Commit

Permalink
Avoid novis footnote in grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Nov 3, 2018
1 parent 28e1cff commit 3e7bb14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
16 changes: 11 additions & 5 deletions src/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

> **<sup>Syntax:<sup>**\
> _Item_:\
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup> [_Visibility_]<sup>?</sup>\
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup>\
> &nbsp;&nbsp; &nbsp;&nbsp; _VisItem_\
> &nbsp;&nbsp; | _MacroItem_
>
> _VisItem_:\
> &nbsp;&nbsp; [_Visibility_]<sup>?</sup>\
> &nbsp;&nbsp; (\
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [_Module_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | [_ExternCrate_]\
Expand All @@ -17,9 +22,12 @@
> &nbsp;&nbsp; &nbsp;&nbsp; | [_Trait_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | [_Implementation_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | [_ExternBlock_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | [_MacroInvocationSemi_]&nbsp;[^novis]\
> &nbsp;&nbsp; &nbsp;&nbsp; | [_MacroRulesDefinition_]&nbsp;[^novis]\
> &nbsp;&nbsp; )
>
> _MacroItem_:\
> &nbsp;&nbsp; &nbsp;&nbsp; [_MacroInvocationSemi_]\
> &nbsp;&nbsp; | [_MacroRulesDefinition_]

An _item_ is a component of a crate. Items are organized within a crate by a
nested set of [modules]. Every crate has a single "outermost" anonymous module;
Expand Down Expand Up @@ -55,8 +63,6 @@ qualified by the name of the enclosing item, or is private to the enclosing
item (in the case of functions). The grammar specifies the exact locations in
which sub-item declarations may appear.

[^novis]: Macros may not start with a visibility modifier.

[_ConstantItem_]: items/constant-items.html
[_Enumeration_]: items/enumerations.html
[_ExternBlock_]: items/external-blocks.html
Expand Down
16 changes: 8 additions & 8 deletions src/items/implementations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
> &nbsp;&nbsp; `}`
>
> _InherentImplItem_ :\
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup>\
> &nbsp;&nbsp; [_Visibility_]<sup>?</sup>\
> &nbsp;&nbsp; ( [_ConstantItem_] | [_Function_] | [_Method_] | [_MacroInvocationSemi_]&nbsp;[^novis] )
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup> (\
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [_MacroInvocationSemi_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | ( [_Visibility_]<sup>?</sup> ( [_ConstantItem_] | [_Function_] | [_Method_] ) )\
> &nbsp;&nbsp; )
>
> _TraitImpl_ :\
> &nbsp;&nbsp; `unsafe`<sup>?</sup> `impl` [_Generics_] `!`<sup>?</sup>
Expand All @@ -25,9 +26,10 @@
> &nbsp;&nbsp; `}`
>
> _TraitImplItem_ :\
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup>\
> &nbsp;&nbsp; [_Visibility_]<sup>?</sup>\
> &nbsp;&nbsp; ( [_TypeAlias_] | [_ConstantItem_] | [_Function_] | [_Method_] | [_MacroInvocationSemi_]&nbsp;[^novis] )
> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup> (\
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [_MacroInvocationSemi_]\
> &nbsp;&nbsp; &nbsp;&nbsp; | ( [_Visibility_]<sup>?</sup> ( [_TypeAlias_] | [_ConstantItem_] | [_Function_] | [_Method_] ) )\
> &nbsp;&nbsp; )
An _implementation_ is an item that associates items with an _implementing type_.
Implementations are defined with the keyword `impl` and contain functions
Expand Down Expand Up @@ -175,8 +177,6 @@ attributes must come before any associated items. That attributes that have
meaning here are [`cfg`], [`deprecated`], [`doc`], and [the lint check
attributes].

[^novis]: Macro invocations may not start with a visibility modifier.

[IDENTIFIER]: identifiers.html
[_ConstantItem_]: items/constant-items.html
[_Function_]: items/functions.html
Expand Down

0 comments on commit 3e7bb14

Please sign in to comment.