mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 06:30:54 +00:00
Cleaned up namespace handling.
A Namespace object is now guaranteed unique. This cleaned up some old workarounds and latent bugs. Change-Id: Ic3f12d89947871b03b2c449ba51b3186f953adde Tested: on Linux. Bug: 21336857
This commit is contained in:
@@ -161,7 +161,7 @@ class GeneralGenerator : public BaseGenerator {
|
||||
GeneralGenerator &operator=(const GeneralGenerator &);
|
||||
bool generate() {
|
||||
std::string one_file_code;
|
||||
cur_name_space_ = parser_.namespaces_.back();
|
||||
cur_name_space_ = parser_.current_namespace_;
|
||||
|
||||
for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end();
|
||||
++it) {
|
||||
@@ -194,7 +194,7 @@ class GeneralGenerator : public BaseGenerator {
|
||||
}
|
||||
|
||||
if (parser_.opts.one_file) {
|
||||
return SaveType(file_name_, *parser_.namespaces_.back(),
|
||||
return SaveType(file_name_, *parser_.current_namespace_,
|
||||
one_file_code, true);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user