OLD | NEW |
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 copy | 6 import copy |
7 import database | 7 import database |
8 import idlparser | 8 import idlparser |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 new_attributes.append(setter_attr) | 122 new_attributes.append(setter_attr) |
123 interface.attributes = new_attributes | 123 interface.attributes = new_attributes |
124 | 124 |
125 # Remove optional annotations from legacy optional arguments. | 125 # Remove optional annotations from legacy optional arguments. |
126 for op in interface.operations: | 126 for op in interface.operations: |
127 for i in range(0, len(op.arguments)): | 127 for i in range(0, len(op.arguments)): |
128 argument = op.arguments[i] | 128 argument = op.arguments[i] |
129 if argument.is_optional: | 129 if argument.is_optional: |
130 if 'Optional' in argument.ext_attrs: | 130 if 'Optional' in argument.ext_attrs: |
131 optional_value = argument.ext_attrs['Optional'] | 131 optional_value = argument.ext_attrs['Optional'] |
132 if optional_value == 'CallWithDefaultValue': | 132 if optional_value: |
133 if (interface.id, op.id, argument.id) not in optional_argument_whi
telist: | 133 if (interface.id, op.id, argument.id) not in optional_argument_whi
telist: |
134 argument.is_optional = False | 134 argument.is_optional = False |
135 del argument.ext_attrs['Optional'] | 135 del argument.ext_attrs['Optional'] |
136 | 136 |
137 # split operations with optional args into multiple operations | 137 # split operations with optional args into multiple operations |
138 new_ops = [] | 138 new_ops = [] |
139 for op in interface.operations: | 139 for op in interface.operations: |
140 for i in range(0, len(op.arguments)): | 140 for i in range(0, len(op.arguments)): |
141 if op.arguments[i].is_optional: | 141 if op.arguments[i].is_optional: |
142 op.arguments[i].is_optional = False | 142 op.arguments[i].is_optional = False |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 annotation = idl_node.annotations[source] | 600 annotation = idl_node.annotations[source] |
601 for name, value in annotation.items(): | 601 for name, value in annotation.items(): |
602 if (name in top_level_annotation | 602 if (name in top_level_annotation |
603 and value == top_level_annotation[name]): | 603 and value == top_level_annotation[name]): |
604 del annotation[name] | 604 del annotation[name] |
605 | 605 |
606 map(normalize, interface.parents) | 606 map(normalize, interface.parents) |
607 map(normalize, interface.constants) | 607 map(normalize, interface.constants) |
608 map(normalize, interface.attributes) | 608 map(normalize, interface.attributes) |
609 map(normalize, interface.operations) | 609 map(normalize, interface.operations) |
OLD | NEW |