OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library kernel.ast_from_binary; | 4 library kernel.ast_from_binary; |
5 | 5 |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 | 8 |
9 import '../ast.dart'; | 9 import '../ast.dart'; |
10 import '../transformations/flags.dart'; | 10 import '../transformations/flags.dart'; |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 return new FunctionType(positional, returnType, | 1077 return new FunctionType(positional, returnType, |
1078 typeParameters: typeParameters, | 1078 typeParameters: typeParameters, |
1079 requiredParameterCount: requiredParameterCount, | 1079 requiredParameterCount: requiredParameterCount, |
1080 namedParameters: named); | 1080 namedParameters: named); |
1081 case Tag.SimpleFunctionType: | 1081 case Tag.SimpleFunctionType: |
1082 var positional = readDartTypeList(); | 1082 var positional = readDartTypeList(); |
1083 var returnType = readDartType(); | 1083 var returnType = readDartType(); |
1084 return new FunctionType(positional, returnType); | 1084 return new FunctionType(positional, returnType); |
1085 case Tag.TypeParameterType: | 1085 case Tag.TypeParameterType: |
1086 int index = readUInt(); | 1086 int index = readUInt(); |
1087 return new TypeParameterType(typeParameterStack[index]); | 1087 var bound = readDartTypeOption(); |
| 1088 return new TypeParameterType(typeParameterStack[index], bound); |
1088 default: | 1089 default: |
1089 throw fail('Invalid dart type tag: $tag'); | 1090 throw fail('Invalid dart type tag: $tag'); |
1090 } | 1091 } |
1091 } | 1092 } |
1092 | 1093 |
1093 List<TypeParameter> readAndPushTypeParameterList( | 1094 List<TypeParameter> readAndPushTypeParameterList( |
1094 [List<TypeParameter> list, TreeNode parent]) { | 1095 [List<TypeParameter> list, TreeNode parent]) { |
1095 int length = readUInt(); | 1096 int length = readUInt(); |
1096 if (length == 0) return list ?? <TypeParameter>[]; | 1097 if (length == 0) return list ?? <TypeParameter>[]; |
1097 if (list == null) { | 1098 if (list == null) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 ..fileOffset = offset | 1159 ..fileOffset = offset |
1159 ..fileEqualsOffset = fileEqualsOffset; | 1160 ..fileEqualsOffset = fileEqualsOffset; |
1160 } | 1161 } |
1161 | 1162 |
1162 int readOffset() { | 1163 int readOffset() { |
1163 // Offset is saved as unsigned, | 1164 // Offset is saved as unsigned, |
1164 // but actually ranges from -1 and up (thus the -1) | 1165 // but actually ranges from -1 and up (thus the -1) |
1165 return readUInt() - 1; | 1166 return readUInt() - 1; |
1166 } | 1167 } |
1167 } | 1168 } |
OLD | NEW |