| 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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 return array_type | 1008 return array_type |
| 1009 | 1009 |
| 1010 return base_type | 1010 return base_type |
| 1011 | 1011 |
| 1012 | 1012 |
| 1013 def type_node_inner_to_type(node): | 1013 def type_node_inner_to_type(node): |
| 1014 node_class = node.GetClass() | 1014 node_class = node.GetClass() |
| 1015 # Note Type*r*ef, not Typedef, meaning the type is an identifier, thus | 1015 # Note Type*r*ef, not Typedef, meaning the type is an identifier, thus |
| 1016 # either a typedef shorthand (but not a Typedef declaration itself) or an | 1016 # either a typedef shorthand (but not a Typedef declaration itself) or an |
| 1017 # interface type. We do not distinguish these, and just use the type name. | 1017 # interface type. We do not distinguish these, and just use the type name. |
| 1018 if node_class in ['PrimitiveType', 'Typeref']: | 1018 if node_class in ['PrimitiveType', 'StringType', 'Typeref']: |
| 1019 # unrestricted syntax: unrestricted double | unrestricted float | 1019 # unrestricted syntax: unrestricted double | unrestricted float |
| 1020 is_unrestricted = bool(node.GetProperty('UNRESTRICTED')) | 1020 is_unrestricted = bool(node.GetProperty('UNRESTRICTED')) |
| 1021 return IdlType(node.GetName(), is_unrestricted=is_unrestricted) | 1021 return IdlType(node.GetName(), is_unrestricted=is_unrestricted) |
| 1022 elif node_class == 'Any': | 1022 elif node_class == 'Any': |
| 1023 return IdlType('any') | 1023 return IdlType('any') |
| 1024 elif node_class in ['Sequence', 'FrozenArray']: | 1024 elif node_class in ['Sequence', 'FrozenArray']: |
| 1025 return sequence_node_to_type(node) | 1025 return sequence_node_to_type(node) |
| 1026 elif node_class == 'UnionType': | 1026 elif node_class == 'UnionType': |
| 1027 return union_type_node_to_idl_union_type(node) | 1027 return union_type_node_to_idl_union_type(node) |
| 1028 elif node_class == 'Promise': | 1028 elif node_class == 'Promise': |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 self.visit_typed_object(argument) | 1115 self.visit_typed_object(argument) |
| 1116 | 1116 |
| 1117 def visit_iterable(self, iterable): | 1117 def visit_iterable(self, iterable): |
| 1118 self.visit_typed_object(iterable) | 1118 self.visit_typed_object(iterable) |
| 1119 | 1119 |
| 1120 def visit_maplike(self, maplike): | 1120 def visit_maplike(self, maplike): |
| 1121 self.visit_typed_object(maplike) | 1121 self.visit_typed_object(maplike) |
| 1122 | 1122 |
| 1123 def visit_setlike(self, setlike): | 1123 def visit_setlike(self, setlike): |
| 1124 self.visit_typed_object(setlike) | 1124 self.visit_typed_object(setlike) |
| OLD | NEW |