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

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

Issue 15074006: Generating annotations from DOM triage list. (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/dartmetadata.py ('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 monitored 10 import monitored
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 """Generates a typedef for the callback interface.""" 444 """Generates a typedef for the callback interface."""
445 typedef_name = self._renamer.RenameInterface(self._interface) 445 typedef_name = self._renamer.RenameInterface(self._interface)
446 if not typedef_name: 446 if not typedef_name:
447 return 447 return
448 448
449 info = GetCallbackInfo(self._interface) 449 info = GetCallbackInfo(self._interface)
450 code = self._library_emitter.FileEmitter(self._interface.id, 450 code = self._library_emitter.FileEmitter(self._interface.id,
451 self._library_name) 451 self._library_name)
452 code.Emit(self._template_loader.Load('callback.darttemplate')) 452 code.Emit(self._template_loader.Load('callback.darttemplate'))
453 453
454 code.Emit('typedef void $NAME($PARAMS);\n', 454 annotations = self._metadata.GetFormattedMetadata(self._library_name,
455 LIBRARYNAME='dart.dom.%s' % self._library_name, 455 self._interface)
456
457 code.Emit('$(ANNOTATIONS)typedef void $NAME($PARAMS);\n',
458 ANNOTATIONS=annotations,
456 NAME=typedef_name, 459 NAME=typedef_name,
457 PARAMS=info.ParametersDeclaration(self._DartType)) 460 PARAMS=info.ParametersDeclaration(self._DartType))
458 self._backend.GenerateCallback(info) 461 self._backend.GenerateCallback(info)
459 462
460 def GenerateInterface(self): 463 def GenerateInterface(self):
461 interface_name = self._interface_type_info.interface_name() 464 interface_name = self._interface_type_info.interface_name()
462 465
463 factory_provider = None 466 factory_provider = None
464 if interface_name in interface_factories: 467 if interface_name in interface_factories:
465 factory_provider = interface_factories[interface_name] 468 factory_provider = interface_factories[interface_name]
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 for library_name in libraries: 1177 for library_name in libraries:
1175 self._libraries[library_name] = DartLibrary( 1178 self._libraries[library_name] = DartLibrary(
1176 library_name, template_loader, library_type, output_dir) 1179 library_name, template_loader, library_type, output_dir)
1177 1180
1178 def AddFile(self, basename, library_name, path): 1181 def AddFile(self, basename, library_name, path):
1179 self._libraries[library_name].AddFile(path) 1182 self._libraries[library_name].AddFile(path)
1180 1183
1181 def Emit(self, emitter, auxiliary_dir): 1184 def Emit(self, emitter, auxiliary_dir):
1182 for lib in self._libraries.values(): 1185 for lib in self._libraries.values():
1183 lib.Emit(emitter, auxiliary_dir) 1186 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« no previous file with comments | « tools/dom/scripts/dartmetadata.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698