| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 elif child_class == 'Argument': | 661 elif child_class == 'Argument': |
| 662 child_name = child.GetName() | 662 child_name = child.GetName() |
| 663 if child_name != '...': | 663 if child_name != '...': |
| 664 raise ValueError('Unrecognized Argument node; expected "..."
, got "%s"' % child_name) | 664 raise ValueError('Unrecognized Argument node; expected "..."
, got "%s"' % child_name) |
| 665 self.is_variadic = bool(child.GetProperty('ELLIPSIS')) | 665 self.is_variadic = bool(child.GetProperty('ELLIPSIS')) |
| 666 elif child_class == 'Default': | 666 elif child_class == 'Default': |
| 667 self.default_value = default_node_to_idl_literal(child) | 667 self.default_value = default_node_to_idl_literal(child) |
| 668 else: | 668 else: |
| 669 raise ValueError('Unrecognized node class: %s' % child_class) | 669 raise ValueError('Unrecognized node class: %s' % child_class) |
| 670 | 670 |
| 671 def __getstate__(self): | |
| 672 # FIXME: Return a picklable object which has enough information to | |
| 673 # unpickle. | |
| 674 return {} | |
| 675 | |
| 676 def __setstate__(self, state): | |
| 677 pass | |
| 678 | |
| 679 def accept(self, visitor): | 671 def accept(self, visitor): |
| 680 visitor.visit_argument(self) | 672 visitor.visit_argument(self) |
| 681 | 673 |
| 682 | 674 |
| 683 def arguments_node_to_arguments(idl_name, node): | 675 def arguments_node_to_arguments(idl_name, node): |
| 684 # [Constructor] and [CustomConstructor] without arguments (the bare form) | 676 # [Constructor] and [CustomConstructor] without arguments (the bare form) |
| 685 # have None instead of an arguments node, but have the same meaning as using | 677 # have None instead of an arguments node, but have the same meaning as using |
| 686 # an empty argument list, [Constructor()], so special-case this. | 678 # an empty argument list, [Constructor()], so special-case this. |
| 687 # http://www.w3.org/TR/WebIDL/#Constructor | 679 # http://www.w3.org/TR/WebIDL/#Constructor |
| 688 if node is None: | 680 if node is None: |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 self.visit_typed_object(argument) | 1119 self.visit_typed_object(argument) |
| 1128 | 1120 |
| 1129 def visit_iterable(self, iterable): | 1121 def visit_iterable(self, iterable): |
| 1130 self.visit_typed_object(iterable) | 1122 self.visit_typed_object(iterable) |
| 1131 | 1123 |
| 1132 def visit_maplike(self, maplike): | 1124 def visit_maplike(self, maplike): |
| 1133 self.visit_typed_object(maplike) | 1125 self.visit_typed_object(maplike) |
| 1134 | 1126 |
| 1135 def visit_setlike(self, setlike): | 1127 def visit_setlike(self, setlike): |
| 1136 self.visit_typed_object(setlike) | 1128 self.visit_typed_object(setlike) |
| OLD | NEW |