Skip to content

Commit

Permalink
Merge pull request rust-lang#88 from brauliobz/grammar_attributes
Browse files Browse the repository at this point in the history
Added attributes grammar
  • Loading branch information
steveklabnik authored Aug 14, 2017
2 parents 74d9a44 + 8483480 commit 998f39e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/attributes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Attributes

> **<sup>Syntax</sup>**
> _Attribute_ :
> &nbsp;&nbsp; _InnerAttribute_ | _OuterAttribute_
>
> _InnerAttribute_ :
> &nbsp;&nbsp; `#![` MetaItem `]`
>
> _OuterAttribute_ :
> &nbsp;&nbsp; `#[` MetaItem `]`
>
> _MetaItem_ :
> &nbsp;&nbsp; &nbsp;&nbsp; IDENTIFIER
> &nbsp;&nbsp; | IDENTIFIER `=` LITERAL
> &nbsp;&nbsp; | IDENTIFIER `(` _MetaSeq_ `)`
> &nbsp;&nbsp; | IDENTIFIER `(` _MetaSeq_ `,` `)`
>
> _MetaSeq_ :
> &nbsp;&nbsp; &nbsp;&nbsp; EMPTY
> &nbsp;&nbsp; | _MetaItem_
> &nbsp;&nbsp; | _MetaSeq_ `,` _MetaItem_
Any item declaration may have an _attribute_ applied to it. Attributes in Rust
are modeled on Attributes in ECMA-335, with the syntax coming from ECMA-334
(C#). An attribute is a general, free-form metadatum that is interpreted
Expand Down

0 comments on commit 998f39e

Please sign in to comment.