| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 include = self._idl_type.replace('Abs', '').replace('Rel', '') | 524 include = self._idl_type.replace('Abs', '').replace('Rel', '') |
| 525 else: | 525 else: |
| 526 include = self._idl_type | 526 include = self._idl_type |
| 527 return ['"%s.h"' % include] + _svg_supplemental_includes | 527 return ['"%s.h"' % include] + _svg_supplemental_includes |
| 528 | 528 |
| 529 def receiver(self): | 529 def receiver(self): |
| 530 return 'receiver->' | 530 return 'receiver->' |
| 531 | 531 |
| 532 def conversion_includes(self): | 532 def conversion_includes(self): |
| 533 def NeededDartTypes(type_name): | 533 def NeededDartTypes(type_name): |
| 534 if type_name == 'Map<String, String>': |
| 535 return ['DOMStringMap'] |
| 534 match = re.match(r'List<(\w*)>$', type_name) | 536 match = re.match(r'List<(\w*)>$', type_name) |
| 535 if match: | 537 if match: |
| 536 return NeededDartTypes(match.group(1)) | 538 return NeededDartTypes(match.group(1)) |
| 537 match = re.match(r'Map<(\w*), (\w*)>$', type_name) | 539 match = re.match(r'Map<(\w*), (\w*)>$', type_name) |
| 538 if match: | 540 if match: |
| 539 return NeededDartTypes(match.group(1)) + NeededDartTypes(match.group(2)) | 541 return NeededDartTypes(match.group(1)) + NeededDartTypes(match.group(2)) |
| 540 if IsPrimitiveType(type_name): | 542 if IsPrimitiveType(type_name): |
| 541 return [] | 543 return [] |
| 542 return [type_name] | 544 return [type_name] |
| 543 | 545 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 '"SVGAnimatedPropertyTearOff.h"', | 679 '"SVGAnimatedPropertyTearOff.h"', |
| 678 '"SVGAnimatedListPropertyTearOff.h"', | 680 '"SVGAnimatedListPropertyTearOff.h"', |
| 679 '"SVGStaticListPropertyTearOff.h"', | 681 '"SVGStaticListPropertyTearOff.h"', |
| 680 '"SVGAnimatedListPropertyTearOff.h"', | 682 '"SVGAnimatedListPropertyTearOff.h"', |
| 681 '"SVGTransformListPropertyTearOff.h"', | 683 '"SVGTransformListPropertyTearOff.h"', |
| 682 '"SVGPathSegListPropertyTearOff.h"', | 684 '"SVGPathSegListPropertyTearOff.h"', |
| 683 ] | 685 ] |
| 684 | 686 |
| 685 def GetIDLTypeInfo(idl_type_name): | 687 def GetIDLTypeInfo(idl_type_name): |
| 686 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) | 688 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) |
| OLD | NEW |