| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 | 8 |
| 9 class IDLNode(object): | 9 class IDLNode(object): |
| 10 """Base class for all IDL elements. | 10 """Base class for all IDL elements. |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 class IDLMember(IDLNode): | 401 class IDLMember(IDLNode): |
| 402 """A base class for constants, attributes and operations.""" | 402 """A base class for constants, attributes and operations.""" |
| 403 | 403 |
| 404 def __init__(self, ast, doc_js_interface_name): | 404 def __init__(self, ast, doc_js_interface_name): |
| 405 IDLNode.__init__(self, ast) | 405 IDLNode.__init__(self, ast) |
| 406 self.type = self._convert_first(ast, 'Type', IDLType) | 406 self.type = self._convert_first(ast, 'Type', IDLType) |
| 407 self._convert_ext_attrs(ast) | 407 self._convert_ext_attrs(ast) |
| 408 self._convert_annotations(ast) | 408 self._convert_annotations(ast) |
| 409 self.doc_js_interface_name = doc_js_interface_name | 409 self.doc_js_interface_name = doc_js_interface_name |
| 410 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs | 410 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs |
| 411 self.is_static = self._has(ast, 'Static') |
| 411 | 412 |
| 412 | 413 |
| 413 class IDLOperation(IDLMember): | 414 class IDLOperation(IDLMember): |
| 414 """IDLNode specialization for 'type name(args)' declarations.""" | 415 """IDLNode specialization for 'type name(args)' declarations.""" |
| 415 def __init__(self, ast, doc_js_interface_name): | 416 def __init__(self, ast, doc_js_interface_name): |
| 416 IDLMember.__init__(self, ast, doc_js_interface_name) | 417 IDLMember.__init__(self, ast, doc_js_interface_name) |
| 417 self.type = self._convert_first(ast, 'ReturnType', IDLType) | 418 self.type = self._convert_first(ast, 'ReturnType', IDLType) |
| 418 self.arguments = self._convert_all(ast, 'Argument', IDLArgument) | 419 self.arguments = self._convert_all(ast, 'Argument', IDLArgument) |
| 419 self.raises = self._convert_first(ast, 'Raises', IDLType) | 420 self.raises = self._convert_first(ast, 'Raises', IDLType) |
| 420 self.specials = self._find_all(ast, 'Special') | 421 self.specials = self._find_all(ast, 'Special') |
| 421 self.is_stringifier = self._has(ast, 'Stringifier') | 422 self.is_stringifier = self._has(ast, 'Stringifier') |
| 422 self.is_static = self._has(ast, 'Static') | |
| 423 def _extra_repr(self): | 423 def _extra_repr(self): |
| 424 return [self.arguments] | 424 return [self.arguments] |
| 425 | 425 |
| 426 | 426 |
| 427 class IDLAttribute(IDLMember): | 427 class IDLAttribute(IDLMember): |
| 428 """IDLNode specialization for 'attribute type name' declarations.""" | 428 """IDLNode specialization for 'attribute type name' declarations.""" |
| 429 def __init__(self, ast, doc_js_interface_name): | 429 def __init__(self, ast, doc_js_interface_name): |
| 430 IDLMember.__init__(self, ast, doc_js_interface_name) | 430 IDLMember.__init__(self, ast, doc_js_interface_name) |
| 431 self.is_read_only = self._has(ast, 'ReadOnly') | 431 self.is_read_only = self._has(ast, 'ReadOnly') |
| 432 # There are various ways to define exceptions for attributes: | 432 # There are various ways to define exceptions for attributes: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 """IDLDictNode specialization for one annotation.""" | 491 """IDLDictNode specialization for one annotation.""" |
| 492 def __init__(self, ast=None): | 492 def __init__(self, ast=None): |
| 493 IDLDictNode.__init__(self, ast) | 493 IDLDictNode.__init__(self, ast) |
| 494 self.id = None | 494 self.id = None |
| 495 if not ast: | 495 if not ast: |
| 496 return | 496 return |
| 497 for arg in self._find_all(ast, 'AnnotationArg'): | 497 for arg in self._find_all(ast, 'AnnotationArg'): |
| 498 name = self._find_first(arg, 'Id') | 498 name = self._find_first(arg, 'Id') |
| 499 value = self._find_first(arg, 'AnnotationArgValue') | 499 value = self._find_first(arg, 'AnnotationArgValue') |
| 500 self[name] = value | 500 self[name] = value |
| OLD | NEW |