Enum definitions are generated without a trailing comma (-pedantic).

Change-Id: I07cd28e5915a0526614db85f894f27a5bd27f3bb
Tested: on Windows.
parent 15b10dd9
......@@ -105,7 +105,8 @@ static void GenComment(const std::string &dc,
auto &ev = **it;
GenComment(ev.doc_comment, code_ptr, " ");
code += " " + enum_def.name + "_" + ev.name + " = ";
code += NumToString(ev.value) + ",\n";
code += NumToString(ev.value);
code += (it + 1) != enum_def.vals.vec.end() ? ",\n" : "\n";
}
code += "};\n\n";
......
......@@ -11,7 +11,7 @@ namespace Example {
enum {
Color_Red = 1,
Color_Green = 2,
Color_Blue = 8,
Color_Blue = 8
};
inline const char **EnumNamesColor() {
......@@ -23,7 +23,7 @@ inline const char *EnumNameColor(int e) { return EnumNamesColor()[e - Color_Red]
enum {
Any_NONE = 0,
Any_Monster = 1,
Any_Monster = 1
};
inline const char **EnumNamesAny() {
......
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