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

Side by Side Diff: lib/html/scripts/dartgenerator.py

Issue 11045020: Merge BaseGenerator into HtmlDartInterfaceGenerator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
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
11 import os 11 import os
12 import re 12 import re
13 import shutil 13 import shutil
14 import systembase
15 from generator import * 14 from generator import *
16 15
17 _logger = logging.getLogger('dartgenerator') 16 _logger = logging.getLogger('dartgenerator')
18 17
19 def MergeNodes(node, other): 18 def MergeNodes(node, other):
20 node.operations.extend(other.operations) 19 node.operations.extend(other.operations)
21 for attribute in other.attributes: 20 for attribute in other.attributes:
22 if not node.has_attribute(attribute): 21 if not node.has_attribute(attribute):
23 node.attributes.append(attribute) 22 node.attributes.append(attribute)
24 23
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ast = [('Annotation', [('Id', 'WebKit')]), 272 ast = [('Annotation', [('Id', 'WebKit')]),
274 ('InterfaceType', ('ScopedName', 'EventTarget'))] 273 ('InterfaceType', ('ScopedName', 'EventTarget'))]
275 interface.parents.append(idlnode.IDLParentInterface(ast)) 274 interface.parents.append(idlnode.IDLParentInterface(ast))
276 275
277 def AddMissingArguments(self, database): 276 def AddMissingArguments(self, database):
278 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'Object')), ('Id', 'arg') ]) 277 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'Object')), ('Id', 'arg') ])
279 for interface in database.GetInterfaces(): 278 for interface in database.GetInterfaces():
280 for operation in interface.operations: 279 for operation in interface.operations:
281 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|CallStack': 280 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|CallStack':
282 operation.arguments.append(ARG) 281 operation.arguments.append(ARG)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698