Skip to content

Commit

Permalink
Update documentation to mention enum value attributes (google#7570)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrdz committed Oct 8, 2022
1 parent 54418f3 commit b80142b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/source/Grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include = `include` string\_constant `;`

namespace\_decl = `namespace` ident ( `.` ident )* `;`

attribute\_decl = `attribute` ident | `"`ident`"` `;`
attribute\_decl = `attribute` ident | `"` ident `"` `;`

type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}`

Expand All @@ -31,7 +31,7 @@ type = `bool` | `byte` | `ubyte` | `short` | `ushort` | `int` | `uint` |
`float32` | `float64` |
`string` | `[` type `]` | ident

enumval\_decl = ident [ `=` integer\_constant ]
enumval\_decl = ident [ `=` integer\_constant ] metadata

metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ]

Expand Down
10 changes: 5 additions & 5 deletions docs/source/Schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ in the corresponding C++ code. Multiple such lines per item are allowed.

### Attributes

Attributes may be attached to a declaration, behind a field, or after
the name of a table/struct/enum/union. These may either have a value or
not. Some attributes like `deprecated` are understood by the compiler;
user defined ones need to be declared with the attribute declaration
(like `priority` in the example above), and are
Attributes may be attached to a declaration, behind a field/enum value,
or after the name of a table/struct/enum/union. These may either have
a value or not. Some attributes like `deprecated` are understood by
the compiler; user defined ones need to be declared with the attribute
declaration (like `priority` in the example above), and are
available to query if you parse the schema at runtime.
This is useful if you write your own code generators/editors etc., and
you wish to add additional information specific to your tool (such as a
Expand Down

0 comments on commit b80142b

Please sign in to comment.