Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: lib/html/scripts/systemhtml.py

Issue 11276062: Emit secondary members in the fixed order. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 the system to generate 6 """This module provides shared functionality for the system to generate
7 Dart:html APIs from the IDL database.""" 7 Dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 import os 10 import os
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 operations = operationsById[id] 403 operations = operationsById[id]
404 info = AnalyzeOperation(interface, operations) 404 info = AnalyzeOperation(interface, operations)
405 self.AddOperation(info) 405 self.AddOperation(info)
406 406
407 def AddSecondaryMembers(self, interface): 407 def AddSecondaryMembers(self, interface):
408 # With multiple inheritance, attributes and operations of non-first 408 # With multiple inheritance, attributes and operations of non-first
409 # interfaces need to be added. Sometimes the attribute or operation is 409 # interfaces need to be added. Sometimes the attribute or operation is
410 # defined in the current interface as well as a parent. In that case we 410 # defined in the current interface as well as a parent. In that case we
411 # avoid making a duplicate definition and pray that the signatures match. 411 # avoid making a duplicate definition and pray that the signatures match.
412 secondary_parents = self._TransitiveSecondaryParents(interface) 412 secondary_parents = self._TransitiveSecondaryParents(interface)
413 for parent_interface in secondary_parents: 413 for parent_interface in sorted(secondary_parents):
414 if isinstance(parent_interface, str): # IsDartCollectionType(parent_inter face) 414 if isinstance(parent_interface, str): # IsDartCollectionType(parent_inter face)
415 continue 415 continue
416 for attr in sorted(parent_interface.attributes, ConstantOutputOrder): 416 for attr in sorted(parent_interface.attributes, ConstantOutputOrder):
417 if not FindMatchingAttribute(interface, attr): 417 if not FindMatchingAttribute(interface, attr):
418 self.AddSecondaryAttribute(parent_interface, attr) 418 self.AddSecondaryAttribute(parent_interface, attr)
419 419
420 # Group overloaded operations by id 420 # Group overloaded operations by id
421 operationsById = {} 421 operationsById = {}
422 for operation in parent_interface.operations: 422 for operation in parent_interface.operations:
423 if operation.id not in operationsById: 423 if operation.id not in operationsById:
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 1116
1117 library_emitter = self._multiemitter.FileEmitter(library_file_path) 1117 library_emitter = self._multiemitter.FileEmitter(library_file_path)
1118 library_file_dir = os.path.dirname(library_file_path) 1118 library_file_dir = os.path.dirname(library_file_path)
1119 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) 1119 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir)
1120 imports_emitter = library_emitter.Emit( 1120 imports_emitter = library_emitter.Emit(
1121 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) 1121 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir))
1122 for path in sorted(self._path_to_emitter.keys()): 1122 for path in sorted(self._path_to_emitter.keys()):
1123 relpath = os.path.relpath(path, library_file_dir) 1123 relpath = os.path.relpath(path, library_file_dir)
1124 imports_emitter.Emit( 1124 imports_emitter.Emit(
1125 "part '$PATH';\n", PATH=massage_path(relpath)) 1125 "part '$PATH';\n", PATH=massage_path(relpath))
OLDNEW
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698