diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2017-01-27 15:28:57 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2017-01-27 15:30:08 -0800 |
commit | 9b3d8b318a3bc9d71d08b50d723996f556557c86 (patch) | |
tree | baba803dfa3abfe3fdf8469f29cebe7fbc700f1d /src | |
parent | 87e29b25def0159ac3d6607595643c2131d7b811 (diff) | |
download | flatbuffers-9b3d8b318a3bc9d71d08b50d723996f556557c86.tar.gz flatbuffers-9b3d8b318a3bc9d71d08b50d723996f556557c86.tar.bz2 flatbuffers-9b3d8b318a3bc9d71d08b50d723996f556557c86.zip |
Added tracking of order of types declared.
Change-Id: Iade313c99f119dcf1619674260648a33f61dc030
Diffstat (limited to 'src')
-rw-r--r-- | src/idl_parser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index fa7b98bf..5974d044 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -1314,6 +1314,8 @@ CheckedError Parser::ParseEnum(bool is_union, EnumDef **dest) { } } if (dest) *dest = &enum_def; + types_.Add(namespaces_.back()->GetFullyQualifiedName(enum_def.name), + new Type(BASE_TYPE_UNION, nullptr, &enum_def)); return NoError(); } @@ -1419,6 +1421,8 @@ CheckedError Parser::ParseDecl() { ECHECK(CheckClash(fields, struct_def, "_byte_vector", BASE_TYPE_STRING)); ECHECK(CheckClash(fields, struct_def, "ByteVector", BASE_TYPE_STRING)); EXPECT('}'); + types_.Add(namespaces_.back()->GetFullyQualifiedName(struct_def->name), + new Type(BASE_TYPE_STRUCT, struct_def, nullptr)); return NoError(); } |