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

Side by Side Diff: lib/dom/scripts/generator.py

Issue 10384122: Fix a build. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « no previous file | 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) 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 systems to generate 6 """This module provides shared functionality for systems to generate
7 Dart APIs from the IDL database.""" 7 Dart APIs from the IDL database."""
8 8
9 import re 9 import re
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 default_value: String holding the expression. None for mandatory parameter. 143 default_value: String holding the expression. None for mandatory parameter.
144 """ 144 """
145 def __init__(self, name, type_id, dart_type, default_value): 145 def __init__(self, name, type_id, dart_type, default_value):
146 self.name = name 146 self.name = name
147 self.type_id = type_id 147 self.type_id = type_id
148 self.dart_type = dart_type 148 self.dart_type = dart_type
149 self.default_value = default_value 149 self.default_value = default_value
150 150
151 def __repr__(self): 151 def __repr__(self):
152 content = 'name = %s, type_id = %s, dart_type = %s, default_value = %s' % ( 152 content = 'name = %s, type_id = %s, dart_type = %s, default_value = %s' % (
153 self.name, self.type_id, self.dart_type, self.default_value)) 153 self.name, self.type_id, self.dart_type, self.default_value)
154 return '<ParamInfo(%s)>' % content 154 return '<ParamInfo(%s)>' % content
155 155
156 156
157 # Given a list of overloaded arguments, render a dart argument. 157 # Given a list of overloaded arguments, render a dart argument.
158 def _DartArg(args, interface): 158 def _DartArg(args, interface):
159 # Given a list of overloaded arguments, choose a suitable name. 159 # Given a list of overloaded arguments, choose a suitable name.
160 def OverloadedName(args): 160 def OverloadedName(args):
161 return '_OR_'.join(sorted(set(arg.id for arg in args))) 161 return '_OR_'.join(sorted(set(arg.id for arg in args)))
162 162
163 # Given a list of overloaded arguments, choose a suitable type. 163 # Given a list of overloaded arguments, choose a suitable type.
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 '"SVGAnimatedListPropertyTearOff.h"', 719 '"SVGAnimatedListPropertyTearOff.h"',
720 '"SVGTransformListPropertyTearOff.h"', 720 '"SVGTransformListPropertyTearOff.h"',
721 '"SVGPathSegListPropertyTearOff.h"', 721 '"SVGPathSegListPropertyTearOff.h"',
722 ] 722 ]
723 723
724 def GetIDLTypeInfo(idl_type_name): 724 def GetIDLTypeInfo(idl_type_name):
725 match = re.match(r'sequence<(\w+)>$', idl_type_name) 725 match = re.match(r'sequence<(\w+)>$', idl_type_name)
726 if match: 726 if match:
727 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1))) 727 return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1)))
728 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name)) 728 return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698