| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, 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 """This module provides shared functionality for systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import re | 9 import re |
| 10 | 10 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 else: | 370 else: |
| 371 if optional: | 371 if optional: |
| 372 raise Exception('Optional parameters cannot precede required ones: ' | 372 raise Exception('Optional parameters cannot precede required ones: ' |
| 373 + str(args)) | 373 + str(args)) |
| 374 required.append(param_info) | 374 required.append(param_info) |
| 375 argtexts = map(FormatParam, required) | 375 argtexts = map(FormatParam, required) |
| 376 if optional: | 376 if optional: |
| 377 argtexts.append('[' + ', '.join(map(FormatParam, optional)) + ']') | 377 argtexts.append('[' + ', '.join(map(FormatParam, optional)) + ']') |
| 378 return ', '.join(argtexts) | 378 return ', '.join(argtexts) |
| 379 | 379 |
| 380 def IsStatic(self): |
| 381 is_static = self.overloads[0].is_static |
| 382 assert any([is_static == o.is_static for o in self.overloads]) |
| 383 return is_static |
| 384 |
| 380 | 385 |
| 381 def AttributeOutputOrder(a, b): | 386 def AttributeOutputOrder(a, b): |
| 382 """Canonical output ordering for attributes.""" | 387 """Canonical output ordering for attributes.""" |
| 383 # Getters before setters: | 388 # Getters before setters: |
| 384 if a.id < b.id: return -1 | 389 if a.id < b.id: return -1 |
| 385 if a.id > b.id: return 1 | 390 if a.id > b.id: return 1 |
| 386 if a.is_fc_setter < b.is_fc_setter: return -1 | 391 if a.is_fc_setter < b.is_fc_setter: return -1 |
| 387 if a.is_fc_setter > b.is_fc_setter: return 1 | 392 if a.is_fc_setter > b.is_fc_setter: return 1 |
| 388 return 0 | 393 return 0 |
| 389 | 394 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 '"SVGAnimatedListPropertyTearOff.h"', | 673 '"SVGAnimatedListPropertyTearOff.h"', |
| 669 '"SVGTransformListPropertyTearOff.h"', | 674 '"SVGTransformListPropertyTearOff.h"', |
| 670 '"SVGPathSegListPropertyTearOff.h"', | 675 '"SVGPathSegListPropertyTearOff.h"', |
| 671 ] | 676 ] |
| 672 | 677 |
| 673 def GetIDLTypeInfo(idl_type_name): | 678 def GetIDLTypeInfo(idl_type_name): |
| 674 match = re.match(r'sequence<(\w+)>$', idl_type_name) | 679 match = re.match(r'sequence<(\w+)>$', idl_type_name) |
| 675 if match: | 680 if match: |
| 676 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1))) | 681 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1))) |
| 677 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) | 682 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) |
| OLD | NEW |