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

Side by Side Diff: lib/dom/scripts/dartgenerator.py

Issue 10334003: Rework static method support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Introducing AddStaticOperation Created 8 years, 7 months 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/dom/idl/dart/dart.idl ('k') | lib/dom/scripts/generator.py » ('j') | 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 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 for operation in interface.operations: 416 for operation in interface.operations:
417 if operation.id not in operationsById: 417 if operation.id not in operationsById:
418 operationsById[operation.id] = [] 418 operationsById[operation.id] = []
419 operationsById[operation.id].append(operation) 419 operationsById[operation.id].append(operation)
420 420
421 # Generate operations 421 # Generate operations
422 for id in sorted(operationsById.keys()): 422 for id in sorted(operationsById.keys()):
423 operations = operationsById[id] 423 operations = operationsById[id]
424 info = AnalyzeOperation(interface, operations) 424 info = AnalyzeOperation(interface, operations)
425 for generator in generators: 425 for generator in generators:
426 generator.AddOperation(info) 426 if info.IsStatic():
427 generator.AddStaticOperation(info)
428 else:
429 generator.AddOperation(info)
427 430
428 # With multiple inheritance, attributes and operations of non-first 431 # With multiple inheritance, attributes and operations of non-first
429 # interfaces need to be added. Sometimes the attribute or operation is 432 # interfaces need to be added. Sometimes the attribute or operation is
430 # defined in the current interface as well as a parent. In that case we 433 # defined in the current interface as well as a parent. In that case we
431 # avoid making a duplicate definition and pray that the signatures match. 434 # avoid making a duplicate definition and pray that the signatures match.
432 435
433 for parent_interface in self._TransitiveSecondaryParents(interface): 436 for parent_interface in self._TransitiveSecondaryParents(interface):
434 if isinstance(parent_interface, str): # IsDartCollectionType(parent_inter face) 437 if isinstance(parent_interface, str): # IsDartCollectionType(parent_inter face)
435 continue 438 continue
436 attributes = [attr for attr in parent_interface.attributes 439 attributes = [attr for attr in parent_interface.attributes
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 634
632 def AddIndexer(self, element_type): 635 def AddIndexer(self, element_type):
633 pass 636 pass
634 637
635 def AddTypedArrayConstructors(self, element_type): 638 def AddTypedArrayConstructors(self, element_type):
636 pass 639 pass
637 640
638 def AddOperation(self, info): 641 def AddOperation(self, info):
639 pass 642 pass
640 643
644 def AddStaticOperation(self, info):
645 pass
646
641 def AddEventAttributes(self, event_attrs): 647 def AddEventAttributes(self, event_attrs):
642 pass 648 pass
OLDNEW
« no previous file with comments | « lib/dom/idl/dart/dart.idl ('k') | lib/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698