Skip to content

Commit fb86e48

Browse files
authored
Fix the definition of MetaItem and MetaSeq
The current definitions mean that the following are valid attributes: - `#[foo(,)]` - `#[foo(, , , , ,)]` These aren't (intended to be) valid. This fixes the definitions to only allow an EMPTY at the end of a comma-separated list.
1 parent 134f419 commit fb86e48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/attributes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
>    | IDENTIFIER `=` LITERAL
1616
>    | IDENTIFIER `(` LITERAL `)`
1717
>    | IDENTIFIER `(` _MetaSeq_ `)`
18-
>    | IDENTIFIER `(` _MetaSeq_ `,` `)`
18+
>    | IDENTIFIER `(` _MetaItem_ `,` _MetaSeq_ `)`
1919
>
2020
> _MetaSeq_ :
2121
>       EMPTY
2222
>    | _MetaItem_
23-
>    | _MetaSeq_ `,` _MetaItem_
23+
>    | _MetaItem_ `,` _MetaSeq_
2424
2525
Any item declaration may have an _attribute_ applied to it. Attributes in Rust
2626
are modeled on Attributes in ECMA-335, with the syntax coming from ECMA-334

0 commit comments

Comments
 (0)