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

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

Issue 8665012: Switch to " native '*Class' " (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « client/dom/generated/src/frog/XSLTProcessor.dart ('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) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, 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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 extends = "" 1922 extends = ""
1923 1923
1924 if interface_name in _constructable_types.keys(): 1924 if interface_name in _constructable_types.keys():
1925 parameters = _constructable_types[interface_name] 1925 parameters = _constructable_types[interface_name]
1926 constructor = ' %s(%s) native;\n\n' % (interface_name, parameters) 1926 constructor = ' %s(%s) native;\n\n' % (interface_name, parameters)
1927 else: 1927 else:
1928 constructor = '' 1928 constructor = ''
1929 1929
1930 (self._members_emitter, self._base_emitter) = self._dart_code.Emit( 1930 (self._members_emitter, self._base_emitter) = self._dart_code.Emit(
1931 '\n' 1931 '\n'
1932 'class $CLASS$BASE native "$CLASS" {\n' 1932 'class $CLASS$BASE native "*$CLASS" {\n'
1933 '$CONSTRUCTOR$!MEMBERS' 1933 '$CONSTRUCTOR$!MEMBERS'
1934 '$!ADDITIONS' 1934 '$!ADDITIONS'
1935 '}\n', 1935 '}\n',
1936 CLASS=self._class_name, BASE=extends, 1936 CLASS=self._class_name, BASE=extends,
1937 INTERFACE=interface_name, CONSTRUCTOR=constructor) 1937 INTERFACE=interface_name, CONSTRUCTOR=constructor)
1938 1938
1939 if not base: 1939 if not base:
1940 # Emit shared base functionality here as we have no common base type. 1940 # Emit shared base functionality here as we have no common base type.
1941 self._base_emitter.Emit( 1941 self._base_emitter.Emit(
1942 '\n' 1942 '\n'
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 Arguments: 2012 Arguments:
2013 info: An OperationInfo object. 2013 info: An OperationInfo object.
2014 """ 2014 """
2015 # TODO(vsm): Handle overloads. 2015 # TODO(vsm): Handle overloads.
2016 self._members_emitter.Emit( 2016 self._members_emitter.Emit(
2017 '\n' 2017 '\n'
2018 ' $TYPE $NAME($ARGS) native;\n', 2018 ' $TYPE $NAME($ARGS) native;\n',
2019 TYPE=info.type_name, 2019 TYPE=info.type_name,
2020 NAME=info.name, 2020 NAME=info.name,
2021 ARGS=info.arg_implementation_declaration) 2021 ARGS=info.arg_implementation_declaration)
OLDNEW
« no previous file with comments | « client/dom/generated/src/frog/XSLTProcessor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698