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

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

Issue 9117013: Refresh dart:dom from WebKit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « client/dom/scripts/dartgenerator.py ('k') | client/dom/scripts/idlparser.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) 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 import sys 6 import sys
7 7
8 8
9 class IDLNode(object): 9 class IDLNode(object):
10 """Base class for all IDL elements. 10 """Base class for all IDL elements.
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 if not self.id: 311 if not self.id:
312 raise SyntaxError('Could not parse type %s' % (ast)) 312 raise SyntaxError('Could not parse type %s' % (ast))
313 313
314 def __label_to_type(self, label, ast): 314 def __label_to_type(self, label, ast):
315 if label.endswith('Type'): 315 if label.endswith('Type'):
316 # Omit 'Type' suffix and lowercase the rest. 316 # Omit 'Type' suffix and lowercase the rest.
317 label = '%s%s' % (label[0].lower(), label[1:-4]) 317 label = '%s%s' % (label[0].lower(), label[1:-4])
318 if label == 'longLong': 318 if label == 'longLong':
319 # Special case for LongLongType: 319 # Special case for LongLongType:
320 label = 'long long' 320 label = 'long long'
321 if label == 'anyArray':
322 label = 'any[]'
323
321 # Add unsigned qualifier. 324 # Add unsigned qualifier.
322 if self._has(ast, 'Unsigned'): 325 if self._has(ast, 'Unsigned'):
323 label = 'unsigned %s' % label 326 label = 'unsigned %s' % label
324 return label 327 return label
325 328
326 329
327 class IDLTypeDef(IDLNode): 330 class IDLTypeDef(IDLNode):
328 """IDLNode for 'typedef [type] [id]' declarations.""" 331 """IDLNode for 'typedef [type] [id]' declarations."""
329 def __init__(self, ast): 332 def __init__(self, ast):
330 IDLNode.__init__(self, ast) 333 IDLNode.__init__(self, ast)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 """IDLDictNode specialization for one annotation.""" 454 """IDLDictNode specialization for one annotation."""
452 def __init__(self, ast=None): 455 def __init__(self, ast=None):
453 IDLDictNode.__init__(self, ast) 456 IDLDictNode.__init__(self, ast)
454 self.id = None 457 self.id = None
455 if not ast: 458 if not ast:
456 return 459 return
457 for arg in self._find_all(ast, 'AnnotationArg'): 460 for arg in self._find_all(ast, 'AnnotationArg'):
458 name = self._find_first(arg, 'Id') 461 name = self._find_first(arg, 'Id')
459 value = self._find_first(arg, 'AnnotationArgValue') 462 value = self._find_first(arg, 'AnnotationArgValue')
460 self[name] = value 463 self[name] = value
OLDNEW
« no previous file with comments | « client/dom/scripts/dartgenerator.py ('k') | client/dom/scripts/idlparser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698