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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 56543003: Add "implemented_in" key in IDL schema compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address kalman's comment Created 7 years, 1 month 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: 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 238fb05e3ce5b388a8c776bd4942f5984801269a..f7959847420eb1496a26ef819b79be522f5eacd3 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -324,11 +324,13 @@ class Namespace(object):
description,
nodoc=False,
internal=False,
- platforms=None):
+ platforms=None,
+ compiler_options=None):
self.namespace = namespace_node
self.nodoc = nodoc
self.internal = internal
self.platforms = platforms
+ self.compiler_options = compiler_options
self.events = []
self.functions = []
self.types = []
@@ -357,7 +359,9 @@ class Namespace(object):
'functions': self.functions,
'internal': self.internal,
'events': self.events,
- 'platforms': self.platforms}
+ 'platforms': self.platforms,
+ 'compiler_options': {}
+ if not self.compiler_options else self.compiler_options}
sergeygs 2013/11/02 06:20:44 I'd prefer: 'compiler_options': self.compiler_opt
Haojian Wu 2013/11/03 01:56:16 Done.
not at google - send to devlin 2013/11/04 15:16:49 The problem with "self.compiler_options or {}" is
def process_interface(self, node):
members = []
@@ -383,6 +387,7 @@ class IDLSchema(object):
internal = False
description = None
platforms = None
+ compiler_options = None
for node in self.idl:
if node.cls == 'Namespace':
if not description:
@@ -390,11 +395,13 @@ class IDLSchema(object):
print('%s must have a namespace-level comment. This will '
'appear on the API summary page.' % node.GetName())
description = ''
- namespace = Namespace(node, description, nodoc, internal, platforms)
+ namespace = Namespace(node, description, nodoc, internal,
+ platforms=platforms, compiler_options=compiler_options)
sergeygs 2013/11/02 06:20:44 Align 'platform...' with 'node' in the preceding l
Haojian Wu 2013/11/03 01:56:16 Done. Thanks for the link.
namespaces.append(namespace.process())
nodoc = False
internal = False
platforms = None
+ compiler_options = None
elif node.cls == 'Copyright':
continue
elif node.cls == 'Comment':
@@ -406,6 +413,8 @@ class IDLSchema(object):
internal = bool(node.value)
elif node.name == 'platforms':
platforms = list(node.value)
+ elif node.name == 'implemented_in':
+ compiler_options = {"implemented_in": node.value}
sergeygs 2013/11/02 06:20:44 Please use single quotes here: { 'implemented_in':
Haojian Wu 2013/11/03 01:56:16 Done. Thanks for the detailed explainations.
else:
continue
else:
« no previous file with comments | « no previous file | tools/json_schema_compiler/idl_schema_test.py » ('j') | tools/json_schema_compiler/idl_schema_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698