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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 273323002: Convert snakecase enum names to camelcase when stringified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final changes Created 6 years, 7 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
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/idl_schema.py
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 991b1c6bb9d060ce44ca842555b345fd2dc509e6..72e4d13b4fd67c9464343d40f40b6c75d3a1e937 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -319,9 +319,9 @@ class Enum(object):
'type': 'string',
'enum': enum}
for property_name in (
- 'inline_doc', 'noinline_doc', 'nodoc', 'cpp_omit_enum_type',):
+ 'inline_doc', 'noinline_doc', 'nodoc', 'cpp_enum_prefix_override',):
if self.node.GetProperty(property_name):
- result[property_name] = True
+ result[property_name] = self.node.GetProperty(property_name)
if self.node.GetProperty('deprecated'):
result[deprecated] = self.node.GetProperty('deprecated')
return result
@@ -407,7 +407,7 @@ class IDLSchema(object):
internal = False
description = None
platforms = None
- compiler_options = None
+ compiler_options = {}
deprecated = None
for node in self.idl:
if node.cls == 'Namespace':
@@ -418,7 +418,7 @@ class IDLSchema(object):
description = ''
namespace = Namespace(node, description, nodoc, internal,
platforms=platforms,
- compiler_options=compiler_options,
+ compiler_options=compiler_options or None,
deprecated=deprecated)
namespaces.append(namespace.process())
nodoc = False
@@ -437,7 +437,9 @@ class IDLSchema(object):
elif node.name == 'platforms':
platforms = list(node.value)
elif node.name == 'implemented_in':
- compiler_options = {'implemented_in': node.value}
+ compiler_options['implemented_in'] = node.value
+ elif node.name == 'camel_case_enum_to_string':
+ compiler_options['camel_case_enum_to_string'] = node.value
elif node.name == 'deprecated':
deprecated = str(node.value)
else:
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698