mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 06:10:00 +00:00
Update documentation to mention enum value attributes (#7570)
This commit is contained in:
@@ -10,7 +10,7 @@ include = `include` string\_constant `;`
|
|||||||
|
|
||||||
namespace\_decl = `namespace` ident ( `.` ident )* `;`
|
namespace\_decl = `namespace` ident ( `.` ident )* `;`
|
||||||
|
|
||||||
attribute\_decl = `attribute` ident | `"`ident`"` `;`
|
attribute\_decl = `attribute` ident | `"` ident `"` `;`
|
||||||
|
|
||||||
type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}`
|
type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}`
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ type = `bool` | `byte` | `ubyte` | `short` | `ushort` | `int` | `uint` |
|
|||||||
`float32` | `float64` |
|
`float32` | `float64` |
|
||||||
`string` | `[` type `]` | ident
|
`string` | `[` type `]` | ident
|
||||||
|
|
||||||
enumval\_decl = ident [ `=` integer\_constant ]
|
enumval\_decl = ident [ `=` integer\_constant ] metadata
|
||||||
|
|
||||||
metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ]
|
metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ]
|
||||||
|
|
||||||
|
|||||||
@@ -309,11 +309,11 @@ in the corresponding C++ code. Multiple such lines per item are allowed.
|
|||||||
|
|
||||||
### Attributes
|
### Attributes
|
||||||
|
|
||||||
Attributes may be attached to a declaration, behind a field, or after
|
Attributes may be attached to a declaration, behind a field/enum value,
|
||||||
the name of a table/struct/enum/union. These may either have a value or
|
or after the name of a table/struct/enum/union. These may either have
|
||||||
not. Some attributes like `deprecated` are understood by the compiler;
|
a value or not. Some attributes like `deprecated` are understood by
|
||||||
user defined ones need to be declared with the attribute declaration
|
the compiler; user defined ones need to be declared with the attribute
|
||||||
(like `priority` in the example above), and are
|
declaration (like `priority` in the example above), and are
|
||||||
available to query if you parse the schema at runtime.
|
available to query if you parse the schema at runtime.
|
||||||
This is useful if you write your own code generators/editors etc., and
|
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
|
you wish to add additional information specific to your tool (such as a
|
||||||
|
|||||||
Reference in New Issue
Block a user