mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 15:01:12 +00:00
The list of enum values is now allowed to end in a comma.
Bug: 16490424 Change-Id: Ic3dd5f06efb5cf2dc4aefbd3f2db64c7b59b6b93 Tested: on OS X.
This commit is contained in:
@@ -725,7 +725,7 @@ void Parser::ParseEnum(bool is_union) {
|
|||||||
if (prevsize && enum_def.vals.vec[prevsize - 1]->value >= ev.value)
|
if (prevsize && enum_def.vals.vec[prevsize - 1]->value >= ev.value)
|
||||||
Error("enum values must be specified in ascending order");
|
Error("enum values must be specified in ascending order");
|
||||||
}
|
}
|
||||||
} while (IsNext(','));
|
} while (IsNext(',') && token_ != '}');
|
||||||
Expect('}');
|
Expect('}');
|
||||||
if (enum_def.attributes.Lookup("bit_flags")) {
|
if (enum_def.attributes.Lookup("bit_flags")) {
|
||||||
for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end();
|
for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ include "include_test1.fbs";
|
|||||||
|
|
||||||
namespace MyGame.Example;
|
namespace MyGame.Example;
|
||||||
|
|
||||||
enum Color:byte (bit_flags) { Red = 0, Green, Blue = 3 }
|
enum Color:byte (bit_flags) { Red = 0, Green, Blue = 3, }
|
||||||
|
|
||||||
union Any { Monster } // TODO: add more elements
|
union Any { Monster } // TODO: add more elements
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user