Fixed inconsistent use of namespace directory prefixing.

Change-Id: I2cab7a1f68b8e643c1057e0a366572421a94ed41
Tested: on Linux.
parent c81239f6
...@@ -1392,8 +1392,7 @@ std::string GeneralMakeRule(const Parser &parser, const std::string &path, ...@@ -1392,8 +1392,7 @@ std::string GeneralMakeRule(const Parser &parser, const std::string &path,
auto &enum_def = **it; auto &enum_def = **it;
if (make_rule != "") make_rule += " "; if (make_rule != "") make_rule += " ";
std::string directory = std::string directory =
BaseGenerator::NamespaceDir(parser, path, *enum_def.defined_namespace) + BaseGenerator::NamespaceDir(parser, path, *enum_def.defined_namespace);
kPathSeparator;
make_rule += directory + enum_def.name + lang.file_extension; make_rule += directory + enum_def.name + lang.file_extension;
} }
...@@ -1402,8 +1401,8 @@ std::string GeneralMakeRule(const Parser &parser, const std::string &path, ...@@ -1402,8 +1401,8 @@ std::string GeneralMakeRule(const Parser &parser, const std::string &path,
auto &struct_def = **it; auto &struct_def = **it;
if (make_rule != "") make_rule += " "; if (make_rule != "") make_rule += " ";
std::string directory = std::string directory =
BaseGenerator::NamespaceDir(parser, path, *struct_def.defined_namespace) + BaseGenerator::NamespaceDir(parser, path,
kPathSeparator; *struct_def.defined_namespace);
make_rule += directory + struct_def.name + lang.file_extension; make_rule += directory + struct_def.name + lang.file_extension;
} }
......
...@@ -89,10 +89,10 @@ namespace php { ...@@ -89,10 +89,10 @@ namespace php {
code += classcode; code += classcode;
std::string filename = NamespaceDir(*def.defined_namespace) + std::string filename = NamespaceDir(*def.defined_namespace) +
kPathSeparator + def.name + ".php"; def.name + ".php";
return SaveFile(filename.c_str(), code, false); return SaveFile(filename.c_str(), code, false);
} }
// Begin a class declaration. // Begin a class declaration.
static void BeginClass(const StructDef &struct_def, std::string *code_ptr) { static void BeginClass(const StructDef &struct_def, std::string *code_ptr) {
std::string &code = *code_ptr; std::string &code = *code_ptr;
...@@ -955,7 +955,7 @@ namespace php { ...@@ -955,7 +955,7 @@ namespace php {
code += Indent + Indent + "return $builder->offset();\n"; code += Indent + Indent + "return $builder->offset();\n";
code += Indent + "}\n"; code += Indent + "}\n";
} }
}; };
} // namespace php } // namespace php
......
...@@ -655,7 +655,7 @@ class PythonGenerator : public BaseGenerator { ...@@ -655,7 +655,7 @@ class PythonGenerator : public BaseGenerator {
BeginFile(LastNamespacePart(*def.defined_namespace), needs_imports, &code); BeginFile(LastNamespacePart(*def.defined_namespace), needs_imports, &code);
code += classcode; code += classcode;
std::string filename = NamespaceDir(*def.defined_namespace) + std::string filename = NamespaceDir(*def.defined_namespace) +
kPathSeparator + def.name + ".py"; def.name + ".py";
return SaveFile(filename.c_str(), code, false); return SaveFile(filename.c_str(), code, false);
} }
}; };
......
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