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

Side by Side Diff: tools/dom/scripts/systemhtml.py

Issue 14036014: Updating DOM code to use list mixins (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/src/ImmutableListMixin.dart » ('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 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 monitored 10 import monitored
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 implements.append(parent_type_info.interface_name()) 513 implements.append(parent_type_info.interface_name())
514 514
515 secure_base_name = self._backend.SecureBaseName(interface_name) 515 secure_base_name = self._backend.SecureBaseName(interface_name)
516 if secure_base_name: 516 if secure_base_name:
517 implements.append(secure_base_name) 517 implements.append(secure_base_name)
518 518
519 implements_str = '' 519 implements_str = ''
520 if implements: 520 if implements:
521 implements_str = ' implements ' + ', '.join(set(implements)) 521 implements_str = ' implements ' + ', '.join(set(implements))
522 522
523 mixins = self._backend.Mixins()
524 mixins_str = ''
525 if mixins:
526 mixins_str = ' with ' + ', '.join(mixins)
527 if not base_class:
528 base_class = 'Object'
529
523 annotations = self._metadata.GetFormattedMetadata( 530 annotations = self._metadata.GetFormattedMetadata(
524 self._library_name, self._interface.doc_js_name, '') 531 self._library_name, self._interface.doc_js_name, '')
525 532
526 class_modifiers = '' 533 class_modifiers = ''
527 if self._renamer.ShouldSuppressInterface(self._interface): 534 if self._renamer.ShouldSuppressInterface(self._interface):
528 class_modifiers = 'abstract ' 535 class_modifiers = 'abstract '
529 536
530 self._implementation_members_emitter = implementation_emitter.Emit( 537 self._implementation_members_emitter = implementation_emitter.Emit(
531 self._backend.ImplementationTemplate(), 538 self._backend.ImplementationTemplate(),
532 LIBRARYNAME='dart.dom.%s' % self._library_name, 539 LIBRARYNAME='dart.dom.%s' % self._library_name,
533 ANNOTATIONS=annotations, 540 ANNOTATIONS=annotations,
534 CLASS_MODIFIERS=class_modifiers, 541 CLASS_MODIFIERS=class_modifiers,
535 CLASSNAME=self._interface_type_info.implementation_name(), 542 CLASSNAME=self._interface_type_info.implementation_name(),
536 EXTENDS=' extends %s' % base_class if base_class else '', 543 EXTENDS=' extends %s' % base_class if base_class else '',
537 IMPLEMENTS=implements_str, 544 IMPLEMENTS=implements_str,
545 MIXINS=mixins_str,
538 DOMNAME=self._interface.doc_js_name, 546 DOMNAME=self._interface.doc_js_name,
539 NATIVESPEC=self._backend.NativeSpec()) 547 NATIVESPEC=self._backend.NativeSpec())
540 self._backend.StartInterface(self._implementation_members_emitter) 548 self._backend.StartInterface(self._implementation_members_emitter)
541 549
542 self._backend.EmitHelpers(base_class) 550 self._backend.EmitHelpers(base_class)
543 self._event_generator.EmitStreamProviders( 551 self._event_generator.EmitStreamProviders(
544 self._interface, 552 self._interface,
545 self._backend.CustomJSMembers(), 553 self._backend.CustomJSMembers(),
546 self._implementation_members_emitter, 554 self._implementation_members_emitter,
547 self._library_name) 555 self._library_name)
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 for library_name in libraries: 1165 for library_name in libraries:
1158 self._libraries[library_name] = DartLibrary( 1166 self._libraries[library_name] = DartLibrary(
1159 library_name, template_loader, library_type, output_dir) 1167 library_name, template_loader, library_type, output_dir)
1160 1168
1161 def AddFile(self, basename, library_name, path): 1169 def AddFile(self, basename, library_name, path):
1162 self._libraries[library_name].AddFile(path) 1170 self._libraries[library_name].AddFile(path)
1163 1171
1164 def Emit(self, emitter, auxiliary_dir): 1172 def Emit(self, emitter, auxiliary_dir):
1165 for lib in self._libraries.values(): 1173 for lib in self._libraries.values():
1166 lib.Emit(emitter, auxiliary_dir) 1174 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/src/ImmutableListMixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698