| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 String name = readStringOrNullIfEmpty(); | 347 String name = readStringOrNullIfEmpty(); |
| 348 // TODO(jensj): We currently save (almost the same) uri twice. | 348 // TODO(jensj): We currently save (almost the same) uri twice. |
| 349 String fileUri = readUriReference(); | 349 String fileUri = readUriReference(); |
| 350 | 350 |
| 351 if (shouldWriteData) { | 351 if (shouldWriteData) { |
| 352 library.isExternal = isExternal; | 352 library.isExternal = isExternal; |
| 353 library.name = name; | 353 library.name = name; |
| 354 library.fileUri = fileUri; | 354 library.fileUri = fileUri; |
| 355 } | 355 } |
| 356 | 356 |
| 357 _readLibraryDependencies(library); | |
| 358 | |
| 359 debugPath.add(library.name ?? library.importUri?.toString() ?? 'library'); | 357 debugPath.add(library.name ?? library.importUri?.toString() ?? 'library'); |
| 360 | 358 |
| 359 _fillTreeNodeList(library.annotations, readExpression, library); |
| 360 _readLibraryDependencies(library); |
| 361 _mergeNamedNodeList(library.typedefs, readTypedef, library); | 361 _mergeNamedNodeList(library.typedefs, readTypedef, library); |
| 362 _mergeNamedNodeList(library.classes, readClass, library); | 362 _mergeNamedNodeList(library.classes, readClass, library); |
| 363 _mergeNamedNodeList(library.fields, readField, library); | 363 _mergeNamedNodeList(library.fields, readField, library); |
| 364 _mergeNamedNodeList(library.procedures, readProcedure, library); | 364 _mergeNamedNodeList(library.procedures, readProcedure, library); |
| 365 | 365 |
| 366 debugPath.removeLast(); | 366 debugPath.removeLast(); |
| 367 _currentLibrary = null; | 367 _currentLibrary = null; |
| 368 return library; | 368 return library; |
| 369 } | 369 } |
| 370 | 370 |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 ..fileOffset = offset | 1191 ..fileOffset = offset |
| 1192 ..fileEqualsOffset = fileEqualsOffset; | 1192 ..fileEqualsOffset = fileEqualsOffset; |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 int readOffset() { | 1195 int readOffset() { |
| 1196 // Offset is saved as unsigned, | 1196 // Offset is saved as unsigned, |
| 1197 // but actually ranges from -1 and up (thus the -1) | 1197 // but actually ranges from -1 and up (thus the -1) |
| 1198 return readUInt() - 1; | 1198 return readUInt() - 1; |
| 1199 } | 1199 } |
| 1200 } | 1200 } |
| OLD | NEW |