| 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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 """ | 73 """ |
| 74 | 74 |
| 75 if conversion_table is None: | 75 if conversion_table is None: |
| 76 conversion_table = {} | 76 conversion_table = {} |
| 77 | 77 |
| 78 # Rename interfaces: | 78 # Rename interfaces: |
| 79 for old_name, new_name in conversion_table.items(): | 79 for old_name, new_name in conversion_table.items(): |
| 80 if database.HasInterface(old_name): | 80 if database.HasInterface(old_name): |
| 81 _logger.info('renaming interface %s to %s' % (old_name, new_name)) | 81 _logger.info('renaming interface %s to %s' % (old_name, new_name)) |
| 82 interface = database.GetInterface(old_name) | 82 interface = database.GetInterface(old_name) |
| 83 database.DeleteInterface(old_name) | |
| 84 if not database.HasInterface(new_name): | 83 if not database.HasInterface(new_name): |
| 85 interface.id = new_name | 84 interface.id = new_name |
| 85 database.DeleteInterface(old_name) |
| 86 database.AddInterface(interface) | 86 database.AddInterface(interface) |
| 87 else: | |
| 88 new_interface = database.GetInterface(new_name) | |
| 89 MergeNodes(new_interface, interface) | |
| 90 | 87 |
| 91 if rename_javascript_binding_names: | 88 if rename_javascript_binding_names: |
| 92 interface.javascript_binding_name = new_name | 89 interface.javascript_binding_name = new_name |
| 93 interface.doc_js_name = new_name | 90 interface.doc_js_name = new_name |
| 94 for member in (interface.operations + interface.constants | 91 for member in (interface.operations + interface.constants |
| 95 + interface.attributes): | 92 + interface.attributes): |
| 96 member.doc_js_interface_name = new_name | 93 member.doc_js_interface_name = new_name |
| 97 | 94 |
| 98 | 95 |
| 99 # Fix references: | 96 # Fix references: |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 PARAMETERS=constructor_info.ParametersImplementationDeclaration()) | 388 PARAMETERS=constructor_info.ParametersImplementationDeclaration()) |
| 392 | 389 |
| 393 def FinishInterface(self): | 390 def FinishInterface(self): |
| 394 pass | 391 pass |
| 395 | 392 |
| 396 def AddTypedArrayConstructors(self, element_type): | 393 def AddTypedArrayConstructors(self, element_type): |
| 397 pass | 394 pass |
| 398 | 395 |
| 399 def AddEventAttributes(self, event_attrs): | 396 def AddEventAttributes(self, event_attrs): |
| 400 pass | 397 pass |
| OLD | NEW |