diff --git a/src/attributes.md b/src/attributes.md index 18d096110..7d7620bdf 100644 --- a/src/attributes.md +++ b/src/attributes.md @@ -1,5 +1,26 @@ # Attributes +> **Syntax** +> _Attribute_ : +>    _InnerAttribute_ | _OuterAttribute_ +> +> _InnerAttribute_ : +>    `#![` MetaItem `]` +> +> _OuterAttribute_ : +>    `#[` MetaItem `]` +> +> _MetaItem_ : +>       IDENTIFIER +>    | IDENTIFIER `=` LITERAL +>    | IDENTIFIER `(` _MetaSeq_ `)` +>    | IDENTIFIER `(` _MetaSeq_ `,` `)` +> +> _MetaSeq_ : +>       EMPTY +>    | _MetaItem_ +>    | _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