Chromium Code Reviews| 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 os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 | 9 |
| 10 class IDLNode(object): | 10 class IDLNode(object): |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 489 # Special case: if it's a setter, ignore 'declared' return type | 489 # Special case: if it's a setter, ignore 'declared' return type |
| 490 self.type = IDLType([('VoidType', None)]) | 490 self.type = IDLType([('VoidType', None)]) |
| 491 elif self.specials == ['deleter']: | 491 elif self.specials == ['deleter']: |
| 492 self.id = '__delete__' | 492 self.id = '__delete__' |
| 493 else: | 493 else: |
| 494 raise Exception('Cannot handle %s: operation has no id' % ast) | 494 raise Exception('Cannot handle %s: operation has no id' % ast) |
| 495 | 495 |
| 496 def _extra_repr(self): | 496 def _extra_repr(self): |
| 497 return [self.arguments] | 497 return [self.arguments] |
| 498 | 498 |
| 499 def ComparableTo(self, operation): | |
|
sra1
2013/08/12 21:31:29
'SameSignatureAs' would be a better name.
blois
2013/08/13 00:22:15
Done.
| |
| 500 if self.type != operation.type: | |
| 501 return False | |
| 502 return [a.type for a in self.arguments] == [a.type for a in operation.argume nts] | |
| 499 | 503 |
| 500 class IDLAttribute(IDLMember): | 504 class IDLAttribute(IDLMember): |
| 501 """IDLNode specialization for 'attribute type name' declarations.""" | 505 """IDLNode specialization for 'attribute type name' declarations.""" |
| 502 def __init__(self, ast, doc_js_interface_name): | 506 def __init__(self, ast, doc_js_interface_name): |
| 503 IDLMember.__init__(self, ast, doc_js_interface_name) | 507 IDLMember.__init__(self, ast, doc_js_interface_name) |
| 504 self.is_read_only = self._has(ast, 'ReadOnly') | 508 self.is_read_only = self._has(ast, 'ReadOnly') |
| 505 # There are various ways to define exceptions for attributes: | 509 # There are various ways to define exceptions for attributes: |
| 506 def _extra_repr(self): | 510 def _extra_repr(self): |
| 507 extra = [] | 511 extra = [] |
| 508 if self.is_read_only: extra.append('readonly') | 512 if self.is_read_only: extra.append('readonly') |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 """IDLDictNode specialization for one annotation.""" | 561 """IDLDictNode specialization for one annotation.""" |
| 558 def __init__(self, ast=None): | 562 def __init__(self, ast=None): |
| 559 IDLDictNode.__init__(self, ast) | 563 IDLDictNode.__init__(self, ast) |
| 560 self.id = None | 564 self.id = None |
| 561 if not ast: | 565 if not ast: |
| 562 return | 566 return |
| 563 for arg in self._find_all(ast, 'AnnotationArg'): | 567 for arg in self._find_all(ast, 'AnnotationArg'): |
| 564 name = self._find_first(arg, 'Id') | 568 name = self._find_first(arg, 'Id') |
| 565 value = self._find_first(arg, 'AnnotationArgValue') | 569 value = self._find_first(arg, 'AnnotationArgValue') |
| 566 self[name] = value | 570 self[name] = value |
| OLD | NEW |