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..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: |