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:
Wouter van Oortmerssen
2017-08-24 12:55:35 -07:00
parent ac1015e3c4
commit 321a1c9dc0
25 changed files with 553 additions and 65 deletions

View File

@@ -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;