From 8483480dffd59243e762ca5790cff2013136ee30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=A1ulio=20Bezerra?= Date: Sat, 22 Jul 2017 09:27:17 -0300 Subject: [PATCH] Added attributes' grammar --- src/attributes.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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