Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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