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

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: update 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/idl_schema_test.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 238fb05e3ce5b388a8c776bd4942f5984801269a..c8c1c8a24ddf17a7c66d40f7a403e82974b7a801 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 = []
@@ -350,6 +352,10 @@ class Namespace(object):
self.types.append(Enum(node).process(self.callbacks))
else:
sys.exit('Did not process %s %s' % (node.cls, node))
+ if self.compiler_options is not None:
+ compiler_options = self.compiler_options
+ else:
+ compiler_options = {}
return {'namespace': self.namespace.GetName(),
'description': self.description,
'nodoc': self.nodoc,
@@ -357,7 +363,8 @@ class Namespace(object):
'functions': self.functions,
'internal': self.internal,
'events': self.events,
- 'platforms': self.platforms}
+ 'platforms': self.platforms,
+ 'compiler_options': compiler_options}
def process_interface(self, node):
members = []
@@ -383,6 +390,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 +398,14 @@ 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)
namespaces.append(namespace.process())
nodoc = False
internal = False
platforms = None
+ compiler_options = None
elif node.cls == 'Copyright':
continue
elif node.cls == 'Comment':
@@ -406,6 +417,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}
else:
continue
else:
« no previous file with comments | « no previous file | tools/json_schema_compiler/idl_schema_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698