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

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

Issue 17141011: Revert "Fixing an issue where EXTDrawBuffers.drawBuffersEXT was not getting generated." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/dom.json ('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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 """ 78 """
79 79
80 for interface in database.GetInterfaces(): 80 for interface in database.GetInterfaces():
81 def IsIdentified(idl_node): 81 def IsIdentified(idl_node):
82 node_name = idl_node.id if idl_node.id else 'parent' 82 node_name = idl_node.id if idl_node.id else 'parent'
83 for idl_type in idl_node.all(idlnode.IDLType): 83 for idl_type in idl_node.all(idlnode.IDLType):
84 type_name = idl_type.id 84 type_name = idl_type.id
85 if (type_name is not None and 85 if (type_name is not None and
86 self._IsCompoundType(database, type_name)): 86 self._IsCompoundType(database, type_name)):
87 continue 87 continue
88 # Ignore constructor warnings. 88 _logger.warn('removing %s in %s which has unidentified type %s' %
89 if not (interface.id in ['DOMWindow', 'WorkerContext'] and
90 type_name.endswith('Constructor')):
91 _logger.warn('removing %s in %s which has unidentified type %s' %
92 (node_name, interface.id, type_name)) 89 (node_name, interface.id, type_name))
93 return False 90 return False
94 return True 91 return True
95 92
96 interface.constants = filter(IsIdentified, interface.constants) 93 interface.constants = filter(IsIdentified, interface.constants)
97 interface.attributes = filter(IsIdentified, interface.attributes) 94 interface.attributes = filter(IsIdentified, interface.attributes)
98 interface.operations = filter(IsIdentified, interface.operations) 95 interface.operations = filter(IsIdentified, interface.operations)
99 interface.parents = filter(IsIdentified, interface.parents) 96 interface.parents = filter(IsIdentified, interface.parents)
100 97
101 def FilterInterfaces(self, database, 98 def FilterInterfaces(self, database,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 ('InterfaceType', ('ScopedName', 'EventTarget'))] 206 ('InterfaceType', ('ScopedName', 'EventTarget'))]
210 interface.parents.append(idlnode.IDLParentInterface(ast)) 207 interface.parents.append(idlnode.IDLParentInterface(ast))
211 208
212 def AddMissingArguments(self, database): 209 def AddMissingArguments(self, database):
213 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ]) 210 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ])
214 for interface in database.GetInterfaces(): 211 for interface in database.GetInterfaces():
215 for operation in interface.operations: 212 for operation in interface.operations:
216 call_with = operation.ext_attrs.get('CallWith', '').split('|') 213 call_with = operation.ext_attrs.get('CallWith', '').split('|')
217 if 'ScriptArguments' in call_with: 214 if 'ScriptArguments' in call_with:
218 operation.arguments.append(ARG) 215 operation.arguments.append(ARG)
OLDNEW
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698