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

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

Issue 22357003: MERGE: 152953-155080 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/idl/dart/dart.idl ('k') | tools/dom/scripts/generator.py » ('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 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if 'EventTarget' in interface.ext_attrs and interface.id != 'EventTarget': 207 if 'EventTarget' in interface.ext_attrs and interface.id != 'EventTarget':
208 ast = [('Annotation', [('Id', 'WebKit')]), 208 ast = [('Annotation', [('Id', 'WebKit')]),
209 ('InterfaceType', ('ScopedName', 'EventTarget'))] 209 ('InterfaceType', ('ScopedName', 'EventTarget'))]
210 interface.parents.append(idlnode.IDLParentInterface(ast)) 210 interface.parents.append(idlnode.IDLParentInterface(ast))
211 211
212 def AddMissingArguments(self, database): 212 def AddMissingArguments(self, database):
213 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ]) 213 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ])
214 for interface in database.GetInterfaces(): 214 for interface in database.GetInterfaces():
215 for operation in interface.operations: 215 for operation in interface.operations:
216 call_with = (operation.ext_attrs.get('CallWith', '').split('|') + 216 call_with = (operation.ext_attrs.get('CallWith', '').split('|') +
217 operation.ext_attrs.get('ConstructorCallWith', '').split('| ')) 217 operation.ext_attrs.get('ConstructorCallWith', '').split('| ') +
218 operation.ext_attrs.get('CallWith', '').split('&') +
219 operation.ext_attrs.get('ConstructorCallWith', '').split('& '))
218 if 'ScriptArguments' in call_with: 220 if 'ScriptArguments' in call_with:
219 operation.arguments.append(ARG) 221 operation.arguments.append(ARG)
OLDNEW
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698