mirror of
https://github.com/google/flatbuffers.git
synced 2025-04-08 09:12:14 +08:00
Update documentation to mention enum value attributes (#7570)
This commit is contained in:
parent
54418f371b
commit
b80142b901
@ -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+ `}`
|
||||
|
||||
@ -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 ] ) `)` ]
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user