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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 } | 1269 } |
1270 | 1270 |
1271 VariableDeclaration readVariableDeclaration() { | 1271 VariableDeclaration readVariableDeclaration() { |
1272 int offset = readOffset(); | 1272 int offset = readOffset(); |
1273 int fileEqualsOffset = readOffset(); | 1273 int fileEqualsOffset = readOffset(); |
1274 int flags = readByte(); | 1274 int flags = readByte(); |
1275 return new VariableDeclaration(readStringOrNullIfEmpty(), | 1275 return new VariableDeclaration(readStringOrNullIfEmpty(), |
1276 type: readDartType(), | 1276 type: readDartType(), |
1277 initializer: readExpressionOption(), | 1277 initializer: readExpressionOption(), |
1278 isFinal: flags & 0x1 != 0, | 1278 isFinal: flags & 0x1 != 0, |
1279 isConst: flags & 0x2 != 0) | 1279 isConst: flags & 0x2 != 0, |
| 1280 isFieldFormal: flags & 04 != 0) |
1280 ..fileOffset = offset | 1281 ..fileOffset = offset |
1281 ..fileEqualsOffset = fileEqualsOffset; | 1282 ..fileEqualsOffset = fileEqualsOffset; |
1282 } | 1283 } |
1283 | 1284 |
1284 int readOffset() { | 1285 int readOffset() { |
1285 // Offset is saved as unsigned, | 1286 // Offset is saved as unsigned, |
1286 // but actually ranges from -1 and up (thus the -1) | 1287 // but actually ranges from -1 and up (thus the -1) |
1287 return readUInt() - 1; | 1288 return readUInt() - 1; |
1288 } | 1289 } |
1289 } | 1290 } |
OLD | NEW |