Fixed root_type not accepting namespaced types.

Change-Id: I272f377742cc0a2c1bfccaa641b54eb9a8c762b6
Tested: on Linux.
parent c44bc6a7
......@@ -1066,8 +1066,10 @@ void Parser::ParseDecl() {
}
bool Parser::SetRootType(const char *name) {
root_struct_def_ = structs_.Lookup(
namespaces_.back()->GetFullyQualifiedName(name));
root_struct_def_ = structs_.Lookup(name);
if (!root_struct_def_)
root_struct_def_ = structs_.Lookup(
namespaces_.back()->GetFullyQualifiedName(name));
return root_struct_def_ != nullptr;
}
......@@ -1440,6 +1442,7 @@ bool Parser::Parse(const char *source, const char **include_paths,
Next();
auto root_type = attribute_;
Expect(kTokenIdentifier);
ParseNamespacing(&root_type, nullptr);
if (!SetRootType(root_type.c_str()))
Error("unknown root type: " + root_type);
if (root_struct_def_->fixed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment