Commit 9deef9ba authored by Jon Skeet's avatar Jon Skeet

Add aliases into enums

parent 10ad653c
...@@ -957,6 +957,8 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -957,6 +957,8 @@ namespace Google.ProtocolBuffers.TestProtos {
FOO1 = 1, FOO1 = 1,
BAR1 = 2, BAR1 = 2,
BAZ = 3, BAZ = 3,
FOO2 = 1,
BAR2 = 2,
} }
public enum TestSparseEnum { public enum TestSparseEnum {
......
...@@ -71,20 +71,18 @@ void EnumGenerator::Generate(io::Printer* printer) { ...@@ -71,20 +71,18 @@ void EnumGenerator::Generate(io::Printer* printer) {
printer->Print(vars, printer->Print(vars,
"$name$ = $number$,\r\n"); "$name$ = $number$,\r\n");
} }
printer->Outdent();
printer->Print("}\r\n\r\n");
// -----------------------------------------------------------------
// TODO(jonskeet): Think about aliases!
/*
for (int i = 0; i < aliases_.size(); i++) { for (int i = 0; i < aliases_.size(); i++) {
map<string, string> vars; map<string, string> vars;
vars["classname"] = descriptor_->name();
vars["name"] = aliases_[i].value->name(); vars["name"] = aliases_[i].value->name();
vars["canonical_name"] = aliases_[i].canonical_value->name(); vars["canonical_number"] = SimpleItoa(aliases_[i].canonical_value->number());
printer->Print(vars, printer->Print(vars,
"public static final $classname$ $name$ = $canonical_name$;\r\n"); "$name$ = $canonical_number$,\r\n");
}*/ }
printer->Outdent();
printer->Print("}\r\n\r\n");
} }
} // namespace csharp } // namespace csharp
......
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