bool generate_name_strings;
bool escape_proto_identifiers;
bool generate_object_based_api;
+ bool union_value_namespacing;
// Possible options for the more general generator below.
enum Language { kJava, kCSharp, kGo, kMAX };
generate_name_strings(false),
escape_proto_identifiers(false),
generate_object_based_api(false),
+ union_value_namespacing(true),
lang(IDLOptions::kJava) {}
};
} else if(arg == "--scoped-enums") {
opts.prefixed_enums = false;
opts.scoped_enums = true;
+ } else if (arg == "--no-union-value-namespacing") {
+ opts.union_value_namespacing = false;
} else if(arg == "--gen-mutable") {
opts.mutable_buffer = true;
} else if(arg == "--gen-name-strings") {
EXPECT(kTokenIdentifier);
if (is_union) {
ECHECK(ParseNamespacing(&full_name, &value_name));
- // Since we can't namespace the actual enum identifiers, turn
- // namespace parts into part of the identifier.
- value_name = full_name;
- std::replace(value_name.begin(), value_name.end(), '.', '_');
+ if (opts.union_value_namespacing) {
+ // Since we can't namespace the actual enum identifiers, turn
+ // namespace parts into part of the identifier.
+ value_name = full_name;
+ std::replace(value_name.begin(), value_name.end(), '.', '_');
+ }
}
auto prevsize = enum_def.vals.vec.size();
auto value = enum_def.vals.vec.size()