| 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 copy | 6 import copy |
| 7 import database | 7 import database |
| 8 import idlparser | 8 import idlparser |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return changed | 399 return changed |
| 400 | 400 |
| 401 def _merge_impl_stmt(self, impl_stmt, import_options): | 401 def _merge_impl_stmt(self, impl_stmt, import_options): |
| 402 """Applies "X implements Y" statemetns on the proper places in the | 402 """Applies "X implements Y" statemetns on the proper places in the |
| 403 database""" | 403 database""" |
| 404 implementor_name = impl_stmt.implementor.id | 404 implementor_name = impl_stmt.implementor.id |
| 405 implemented_name = impl_stmt.implemented.id | 405 implemented_name = impl_stmt.implemented.id |
| 406 _logger.info('merging impl stmt %s implements %s' % | 406 _logger.info('merging impl stmt %s implements %s' % |
| 407 (implementor_name, implemented_name)) | 407 (implementor_name, implemented_name)) |
| 408 | 408 |
| 409 if implementor_name == implemented_name: | |
| 410 # After renaming, this might happen (e.g. Window impls | |
| 411 # AbstractView, but AbstractView was renamed to Window). | |
| 412 return | |
| 413 | |
| 414 source = import_options.source | 409 source = import_options.source |
| 415 if self._database.HasInterface(implementor_name): | 410 if self._database.HasInterface(implementor_name): |
| 416 interface = self._database.GetInterface(implementor_name) | 411 interface = self._database.GetInterface(implementor_name) |
| 417 if interface.parents is None: | 412 if interface.parents is None: |
| 418 interface.parents = [] | 413 interface.parents = [] |
| 419 for parent in interface.parents: | 414 for parent in interface.parents: |
| 420 if parent.type.id == implemented_name: | 415 if parent.type.id == implemented_name: |
| 421 if source and source not in parent.annotations: | 416 if source and source not in parent.annotations: |
| 422 parent.annotations[source] = IDLAnnotation( | 417 parent.annotations[source] = IDLAnnotation( |
| 423 import_options.source_attributes) | 418 import_options.source_attributes) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 annotation = idl_node.annotations[source] | 577 annotation = idl_node.annotations[source] |
| 583 for name, value in annotation.items(): | 578 for name, value in annotation.items(): |
| 584 if (name in top_level_annotation | 579 if (name in top_level_annotation |
| 585 and value == top_level_annotation[name]): | 580 and value == top_level_annotation[name]): |
| 586 del annotation[name] | 581 del annotation[name] |
| 587 | 582 |
| 588 map(normalize, interface.parents) | 583 map(normalize, interface.parents) |
| 589 map(normalize, interface.constants) | 584 map(normalize, interface.constants) |
| 590 map(normalize, interface.attributes) | 585 map(normalize, interface.attributes) |
| 591 map(normalize, interface.operations) | 586 map(normalize, interface.operations) |
| OLD | NEW |