summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2017-01-27 15:28:57 -0800
committerWouter van Oortmerssen <aardappel@gmail.com>2017-01-27 15:30:08 -0800
commit9b3d8b318a3bc9d71d08b50d723996f556557c86 (patch)
treebaba803dfa3abfe3fdf8469f29cebe7fbc700f1d /src
parent87e29b25def0159ac3d6607595643c2131d7b811 (diff)
downloadflatbuffers-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.cpp4
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();
}