| OLD | NEW |
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import itertools | 6 import itertools |
| 7 import json | 7 import json |
| 8 import os.path | 8 import os.path |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 raise ValueError('Did not process %s %s' % (child.cls, child)) | 302 raise ValueError('Did not process %s %s' % (child.cls, child)) |
| 303 enum.append(enum_value) | 303 enum.append(enum_value) |
| 304 elif node.cls == 'Comment': | 304 elif node.cls == 'Comment': |
| 305 self.description = ProcessComment(node.GetName())[0] | 305 self.description = ProcessComment(node.GetName())[0] |
| 306 else: | 306 else: |
| 307 sys.exit('Did not process %s %s' % (node.cls, node)) | 307 sys.exit('Did not process %s %s' % (node.cls, node)) |
| 308 result = {'id' : self.node.GetName(), | 308 result = {'id' : self.node.GetName(), |
| 309 'description': self.description, | 309 'description': self.description, |
| 310 'type': 'string', | 310 'type': 'string', |
| 311 'enum': enum} | 311 'enum': enum} |
| 312 for property_name in ('inline_doc', 'noinline_doc', 'nodoc'): | 312 for property_name in ( |
| 313 'inline_doc', 'noinline_doc', 'nodoc', 'cpp_omit_enum_type',): |
| 313 if self.node.GetProperty(property_name): | 314 if self.node.GetProperty(property_name): |
| 314 result[property_name] = True | 315 result[property_name] = True |
| 315 if self.node.GetProperty('deprecated'): | 316 if self.node.GetProperty('deprecated'): |
| 316 result[deprecated] = self.node.GetProperty('deprecated') | 317 result[deprecated] = self.node.GetProperty('deprecated') |
| 317 return result | 318 return result |
| 318 | 319 |
| 319 | 320 |
| 320 class Namespace(object): | 321 class Namespace(object): |
| 321 ''' | 322 ''' |
| 322 Given an IDLNode representing an IDL namespace, converts into a Python | 323 Given an IDLNode representing an IDL namespace, converts into a Python |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 Dump a json serialization of parse result for the IDL files whose names | 458 Dump a json serialization of parse result for the IDL files whose names |
| 458 were passed in on the command line. | 459 were passed in on the command line. |
| 459 ''' | 460 ''' |
| 460 for filename in sys.argv[1:]: | 461 for filename in sys.argv[1:]: |
| 461 schema = Load(filename) | 462 schema = Load(filename) |
| 462 print json.dumps(schema, indent=2) | 463 print json.dumps(schema, indent=2) |
| 463 | 464 |
| 464 | 465 |
| 465 if __name__ == '__main__': | 466 if __name__ == '__main__': |
| 466 Main() | 467 Main() |
| OLD | NEW |