Chromium Code Reviews| 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..8317d0b481e8223c459df8125de30f0c65ce24df 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={}): |
|
not at google - send to devlin
2013/11/02 00:01:52
don't put objects as default values. they're share
Haojian Wu
2013/11/02 01:27:33
Done.
|
| 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,8 @@ class Namespace(object): |
| 'functions': self.functions, |
| 'internal': self.internal, |
| 'events': self.events, |
| - 'platforms': self.platforms} |
| + 'platforms': self.platforms, |
| + 'compiler_options': self.compiler_options} |
| def process_interface(self, node): |
| members = [] |
| @@ -383,6 +386,7 @@ class IDLSchema(object): |
| internal = False |
| description = None |
| platforms = None |
| + compiler_options = {} |
|
not at google - send to devlin
2013/11/02 00:01:52
=None?
Haojian Wu
2013/11/02 01:27:33
Done.
|
| for node in self.idl: |
| if node.cls == 'Namespace': |
| if not description: |
| @@ -390,7 +394,8 @@ 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, |
| + compiler_options) |
|
not at google - send to devlin
2013/11/02 00:01:52
name optional arguments. platforms=platforms, comp
Haojian Wu
2013/11/02 01:27:33
Done.
|
| namespaces.append(namespace.process()) |
| nodoc = False |
| internal = False |
| @@ -406,6 +411,8 @@ class IDLSchema(object): |
| internal = bool(node.value) |
| elif node.name == 'platforms': |
| platforms = list(node.value) |
| + elif node.name == 'implemented_in': |
| + compiler_options = dict(implemented_in=node.value) |
|
not at google - send to devlin
2013/11/02 00:01:52
personally I would prefer {'implemented_in': node.
Haojian Wu
2013/11/02 01:27:33
Done.
|
| else: |
| continue |
| else: |