mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 05:27:24 +00:00
Allow unions of table types with the same name but from different namespaces.
Also fixed most codegenerators using the wrong namespace when multiple namespace were used in a file, with some files not being generated. Change-Id: Ib42969221239d7244e431cbd667ef69200fc415f Tested: on Linux. Bug: 29338474
This commit is contained in:
@@ -1180,7 +1180,13 @@ CheckedError Parser::ParseEnum(bool is_union, EnumDef **dest) {
|
||||
auto full_name = value_name;
|
||||
std::vector<std::string> value_comment = doc_comment_;
|
||||
EXPECT(kTokenIdentifier);
|
||||
if (is_union) ECHECK(ParseNamespacing(&full_name, &value_name));
|
||||
if (is_union) {
|
||||
ECHECK(ParseNamespacing(&full_name, &value_name));
|
||||
// Since we can't namespace the actual enum identifiers, turn
|
||||
// namespace parts into part of the identifier.
|
||||
value_name = full_name;
|
||||
std::replace(value_name.begin(), value_name.end(), '.', '_');
|
||||
}
|
||||
auto prevsize = enum_def.vals.vec.size();
|
||||
auto value = enum_def.vals.vec.size()
|
||||
? enum_def.vals.vec.back()->value + 1
|
||||
|
||||
Reference in New Issue
Block a user