Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: trunk/src/tools/json_schema_compiler/cc_generator.py

Issue 47403003: Revert 231982 "Docserver: Display enum value descriptions in API..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/tools/json_schema_compiler/cc_generator.py
===================================================================
--- trunk/src/tools/json_schema_compiler/cc_generator.py (revision 232015)
+++ trunk/src/tools/json_schema_compiler/cc_generator.py (working copy)
@@ -784,9 +784,7 @@
self._type_helper.GetEnumNoneValue(type_)))
.Concat(self._GenerateError(
'\"\'%%(key)s\': expected \\"' +
- '\\" or \\"'.join(
- enum_value.name
- for enum_value in self._type_helper.FollowRef(type_).enum_values) +
+ '\\" or \\"'.join(self._type_helper.FollowRef(type_).enum_values) +
'\\", got \\"" + %s + "\\""' % enum_as_string))
.Append('return %s;' % failure_value)
.Eblock('}')
@@ -822,7 +820,7 @@
c.Sblock('switch (enum_param) {')
for enum_value in self._type_helper.FollowRef(type_).enum_values:
(c.Append('case %s: ' % self._type_helper.GetEnumValue(type_, enum_value))
- .Append(' return "%s";' % enum_value.name))
+ .Append(' return "%s";' % enum_value))
(c.Append('case %s:' % self._type_helper.GetEnumNoneValue(type_))
.Append(' return "";')
.Eblock('}')
@@ -850,7 +848,7 @@
# This is broken up into all ifs with no else ifs because we get
# "fatal error C1061: compiler limit : blocks nested too deeply"
# on Windows.
- (c.Append('if (enum_string == "%s")' % enum_value.name)
+ (c.Append('if (enum_string == "%s")' % enum_value)
.Append(' return %s;' %
self._type_helper.GetEnumValue(type_, enum_value)))
(c.Append('return %s;' % self._type_helper.GetEnumNoneValue(type_))

Powered by Google App Engine
This is Rietveld 408576698