| 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 monitored | 10 import monitored |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 TARGET=target, | 1005 TARGET=target, |
| 1006 PARAMS=', '.join(target_parameters)) | 1006 PARAMS=', '.join(target_parameters)) |
| 1007 | 1007 |
| 1008 declaration = '%s%s%s %s(%s)' % ( | 1008 declaration = '%s%s%s %s(%s)' % ( |
| 1009 self._Metadata(info.type_name, info.declared_name), | 1009 self._Metadata(info.type_name, info.declared_name), |
| 1010 'static ' if info.IsStatic() else '', | 1010 'static ' if info.IsStatic() else '', |
| 1011 return_type, | 1011 return_type, |
| 1012 html_name, | 1012 html_name, |
| 1013 info.ParametersDeclaration(InputType)) | 1013 info.ParametersDeclaration(InputType)) |
| 1014 self._GenerateDispatcherBody( | 1014 self._GenerateDispatcherBody( |
| 1015 info, |
| 1015 operations, | 1016 operations, |
| 1016 parameter_names, | |
| 1017 declaration, | 1017 declaration, |
| 1018 GenerateCall, | 1018 GenerateCall, |
| 1019 lambda _, argument: IsOptional(argument), | 1019 lambda _, argument: IsOptional(argument), |
| 1020 can_omit_type_check=lambda type, pos: type == parameter_types[pos]) | 1020 can_omit_type_check=lambda type, pos: type == parameter_types[pos]) |
| 1021 | 1021 |
| 1022 def _AddInterfaceOperation(self, info, html_name): | 1022 def _AddInterfaceOperation(self, info, html_name): |
| 1023 self._members_emitter.Emit( | 1023 self._members_emitter.Emit( |
| 1024 '\n' | 1024 '\n' |
| 1025 ' $TYPE $NAME($PARAMS);\n', | 1025 ' $TYPE $NAME($PARAMS);\n', |
| 1026 TYPE=self.SecureOutputType(info.type_name), | 1026 TYPE=self.SecureOutputType(info.type_name), |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 for library_name in libraries: | 1177 for library_name in libraries: |
| 1178 self._libraries[library_name] = DartLibrary( | 1178 self._libraries[library_name] = DartLibrary( |
| 1179 library_name, template_loader, library_type, output_dir) | 1179 library_name, template_loader, library_type, output_dir) |
| 1180 | 1180 |
| 1181 def AddFile(self, basename, library_name, path): | 1181 def AddFile(self, basename, library_name, path): |
| 1182 self._libraries[library_name].AddFile(path) | 1182 self._libraries[library_name].AddFile(path) |
| 1183 | 1183 |
| 1184 def Emit(self, emitter, auxiliary_dir): | 1184 def Emit(self, emitter, auxiliary_dir): |
| 1185 for lib in self._libraries.values(): | 1185 for lib in self._libraries.values(): |
| 1186 lib.Emit(emitter, auxiliary_dir) | 1186 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |