OLD | NEW |
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 418 |
419 def NativeSpec(self): | 419 def NativeSpec(self): |
420 native_spec = MakeNativeSpec(self._interface.javascript_binding_name) | 420 native_spec = MakeNativeSpec(self._interface.javascript_binding_name) |
421 return ' native "%s"' % native_spec | 421 return ' native "%s"' % native_spec |
422 | 422 |
423 def ImplementationTemplate(self): | 423 def ImplementationTemplate(self): |
424 if IsPureInterface(self._interface.id): | 424 if IsPureInterface(self._interface.id): |
425 return self._template_loader.Load('pure_interface.darttemplate') | 425 return self._template_loader.Load('pure_interface.darttemplate') |
426 | 426 |
427 template_file = ('impl_%s.darttemplate' % | 427 template_file = ('impl_%s.darttemplate' % |
428 self._interface_type_info.interface_name()) | 428 self._interface.doc_js_name) |
429 return (self._template_loader.TryLoad(template_file) or | 429 return (self._template_loader.TryLoad(template_file) or |
430 self._template_loader.Load('dart2js_impl.darttemplate')) | 430 self._template_loader.Load('dart2js_impl.darttemplate')) |
431 | 431 |
432 def StartInterface(self, emitter): | 432 def StartInterface(self, emitter): |
433 self._members_emitter = emitter | 433 self._members_emitter = emitter |
434 | 434 |
435 def FinishInterface(self): | 435 def FinishInterface(self): |
436 pass | 436 pass |
437 | 437 |
438 def EmitFactoryProvider(self, constructor_info, factory_provider, emitter): | 438 def EmitFactoryProvider(self, constructor_info, factory_provider, emitter): |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 for library_name in libraries: | 982 for library_name in libraries: |
983 self._libraries[library_name] = DartLibrary( | 983 self._libraries[library_name] = DartLibrary( |
984 library_name, template_loader, library_type, output_dir) | 984 library_name, template_loader, library_type, output_dir) |
985 | 985 |
986 def AddFile(self, basename, library_name, path): | 986 def AddFile(self, basename, library_name, path): |
987 self._libraries[library_name].AddFile(path) | 987 self._libraries[library_name].AddFile(path) |
988 | 988 |
989 def Emit(self, emitter, auxiliary_dir): | 989 def Emit(self, emitter, auxiliary_dir): |
990 for lib in self._libraries.values(): | 990 for lib in self._libraries.values(): |
991 lib.Emit(emitter, auxiliary_dir) | 991 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |