mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 17:06:10 +00:00
Fixed root_type not accepting namespaced types.
Change-Id: I272f377742cc0a2c1bfccaa641b54eb9a8c762b6 Tested: on Linux.
This commit is contained in:
@@ -1066,8 +1066,10 @@ void Parser::ParseDecl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Parser::SetRootType(const char *name) {
|
bool Parser::SetRootType(const char *name) {
|
||||||
root_struct_def_ = structs_.Lookup(
|
root_struct_def_ = structs_.Lookup(name);
|
||||||
namespaces_.back()->GetFullyQualifiedName(name));
|
if (!root_struct_def_)
|
||||||
|
root_struct_def_ = structs_.Lookup(
|
||||||
|
namespaces_.back()->GetFullyQualifiedName(name));
|
||||||
return root_struct_def_ != nullptr;
|
return root_struct_def_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1440,6 +1442,7 @@ bool Parser::Parse(const char *source, const char **include_paths,
|
|||||||
Next();
|
Next();
|
||||||
auto root_type = attribute_;
|
auto root_type = attribute_;
|
||||||
Expect(kTokenIdentifier);
|
Expect(kTokenIdentifier);
|
||||||
|
ParseNamespacing(&root_type, nullptr);
|
||||||
if (!SetRootType(root_type.c_str()))
|
if (!SetRootType(root_type.c_str()))
|
||||||
Error("unknown root type: " + root_type);
|
Error("unknown root type: " + root_type);
|
||||||
if (root_struct_def_->fixed)
|
if (root_struct_def_->fixed)
|
||||||
|
|||||||
Reference in New Issue
Block a user