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

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

Issue 14636013: Revert "Changes for webkit roll 148757-149482" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « tools/dom/scripts/htmlrenamer.py ('k') | tools/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 os 6 import os
7 import sys 7 import sys
8 8
9 9
10 class IDLNode(object): 10 class IDLNode(object):
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 def __init__(self, ast): 403 def __init__(self, ast):
404 IDLNode.__init__(self, ast) 404 IDLNode.__init__(self, ast)
405 self._convert_ext_attrs(ast) 405 self._convert_ext_attrs(ast)
406 self._convert_annotations(ast) 406 self._convert_annotations(ast)
407 self.parents = self._convert_all(ast, 'ParentInterface', 407 self.parents = self._convert_all(ast, 'ParentInterface',
408 IDLParentInterface) 408 IDLParentInterface)
409 javascript_interface_name = self.ext_attrs.get('InterfaceName', self.id) 409 javascript_interface_name = self.ext_attrs.get('InterfaceName', self.id)
410 self.javascript_binding_name = javascript_interface_name 410 self.javascript_binding_name = javascript_interface_name
411 self.doc_js_name = javascript_interface_name 411 self.doc_js_name = javascript_interface_name
412
413 if not (self._find_first(ast, 'Callback') is None):
414 self.ext_attrs['Callback'] = None
415 if not (self._find_first(ast, 'Partial') is None):
416 self.is_supplemental = True
417 self.ext_attrs['Supplemental'] = None
418
419 self.operations = self._convert_all(ast, 'Operation', 412 self.operations = self._convert_all(ast, 'Operation',
420 lambda ast: IDLOperation(ast, self.doc_js_name)) 413 lambda ast: IDLOperation(ast, self.doc_js_name))
421 self.attributes = self._convert_all(ast, 'Attribute', 414 self.attributes = self._convert_all(ast, 'Attribute',
422 lambda ast: IDLAttribute(ast, self.doc_js_name)) 415 lambda ast: IDLAttribute(ast, self.doc_js_name))
423 self.constants = self._convert_all(ast, 'Const', 416 self.constants = self._convert_all(ast, 'Const',
424 lambda ast: IDLConstant(ast, self.doc_js_name)) 417 lambda ast: IDLConstant(ast, self.doc_js_name))
425 self.is_supplemental = 'Supplemental' in self.ext_attrs 418 self.is_supplemental = 'Supplemental' in self.ext_attrs
426 self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs 419 self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs
427 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs 420 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs
428 421
429
430 def reset_id(self, new_id): 422 def reset_id(self, new_id):
431 """Reset the id of the Interface and corresponding the JS names.""" 423 """Reset the id of the Interface and corresponding the JS names."""
432 if self.id != new_id: 424 if self.id != new_id:
433 self.id = new_id 425 self.id = new_id
434 self.doc_js_name = new_id 426 self.doc_js_name = new_id
435 self.javascript_binding_name = new_id 427 self.javascript_binding_name = new_id
436 for member in self.operations: 428 for member in self.operations:
437 member.doc_js_interface_name = new_id 429 member.doc_js_interface_name = new_id
438 for member in self.attributes: 430 for member in self.attributes:
439 member.doc_js_interface_name = new_id 431 member.doc_js_interface_name = new_id
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 self.value = self._find_first(ast, 'ConstExpr') 492 self.value = self._find_first(ast, 'ConstExpr')
501 493
502 494
503 class IDLArgument(IDLNode): 495 class IDLArgument(IDLNode):
504 """IDLNode specialization for operation arguments.""" 496 """IDLNode specialization for operation arguments."""
505 def __init__(self, ast): 497 def __init__(self, ast):
506 IDLNode.__init__(self, ast) 498 IDLNode.__init__(self, ast)
507 self.type = self._convert_first(ast, 'Type', IDLType) 499 self.type = self._convert_first(ast, 'Type', IDLType)
508 self.optional = self._has(ast, 'Optional') 500 self.optional = self._has(ast, 'Optional')
509 self._convert_ext_attrs(ast) 501 self._convert_ext_attrs(ast)
510 # TODO(vsm): Recover this from the type instead.
511 if 'Callback' in self.type.id:
512 self.ext_attrs['Callback'] = None
513 502
514 def __repr__(self): 503 def __repr__(self):
515 return '<IDLArgument(type = %s, id = %s)>' % (self.type, self.id) 504 return '<IDLArgument(type = %s, id = %s)>' % (self.type, self.id)
516 505
517 506
518 class IDLImplementsStatement(IDLNode): 507 class IDLImplementsStatement(IDLNode):
519 """IDLNode specialization for 'X implements Y' declarations.""" 508 """IDLNode specialization for 'X implements Y' declarations."""
520 def __init__(self, ast): 509 def __init__(self, ast):
521 IDLNode.__init__(self, ast) 510 IDLNode.__init__(self, ast)
522 self.implementor = self._convert_first(ast, 'ImplStmtImplementor', 511 self.implementor = self._convert_first(ast, 'ImplStmtImplementor',
(...skipping 19 matching lines...) Expand all
542 """IDLDictNode specialization for one annotation.""" 531 """IDLDictNode specialization for one annotation."""
543 def __init__(self, ast=None): 532 def __init__(self, ast=None):
544 IDLDictNode.__init__(self, ast) 533 IDLDictNode.__init__(self, ast)
545 self.id = None 534 self.id = None
546 if not ast: 535 if not ast:
547 return 536 return
548 for arg in self._find_all(ast, 'AnnotationArg'): 537 for arg in self._find_all(ast, 'AnnotationArg'):
549 name = self._find_first(arg, 'Id') 538 name = self._find_first(arg, 'Id')
550 value = self._find_first(arg, 'AnnotationArgValue') 539 value = self._find_first(arg, 'AnnotationArgValue')
551 self[name] = value 540 self[name] = value
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/scripts/idlparser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698