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 | 4 |
5 library fasta.source_loader; | 5 library fasta.source_loader; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show FileSystemException; | 9 import 'dart:io' show FileSystemException; |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 import 'diet_parser.dart' show DietParser; | 39 import 'diet_parser.dart' show DietParser; |
40 | 40 |
41 import 'outline_builder.dart' show OutlineBuilder; | 41 import 'outline_builder.dart' show OutlineBuilder; |
42 | 42 |
43 import 'source_class_builder.dart' show SourceClassBuilder; | 43 import 'source_class_builder.dart' show SourceClassBuilder; |
44 | 44 |
45 import 'source_library_builder.dart' show SourceLibraryBuilder; | 45 import 'source_library_builder.dart' show SourceLibraryBuilder; |
46 | 46 |
47 class SourceLoader<L> extends Loader<L> { | 47 class SourceLoader<L> extends Loader<L> { |
48 final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{}; | 48 final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{}; |
49 final excludeSource = CompilerContext.current.options.excludeSource; | 49 final bool excludeSource = CompilerContext.current.options.excludeSource; |
50 | 50 |
51 // Used when building directly to kernel. | 51 // Used when building directly to kernel. |
52 ClassHierarchy hierarchy; | 52 ClassHierarchy hierarchy; |
53 CoreTypes coreTypes; | 53 CoreTypes coreTypes; |
54 | 54 |
55 SourceLoader(TargetImplementation target) : super(target); | 55 SourceLoader(TargetImplementation target) : super(target); |
56 | 56 |
57 Future<Token> tokenize(SourceLibraryBuilder library, | 57 Future<Token> tokenize(SourceLibraryBuilder library, |
58 {bool suppressLexicalErrors: false}) async { | 58 {bool suppressLexicalErrors: false}) async { |
59 Uri uri = library.fileUri; | 59 Uri uri = library.fileUri; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 362 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
363 assert(hierarchy != null); | 363 assert(hierarchy != null); |
364 for (SourceClassBuilder builder in sourceClasses) { | 364 for (SourceClassBuilder builder in sourceClasses) { |
365 builder.checkOverrides(hierarchy); | 365 builder.checkOverrides(hierarchy); |
366 } | 366 } |
367 ticker.logMs("Checked overrides"); | 367 ticker.logMs("Checked overrides"); |
368 } | 368 } |
369 | 369 |
370 List<Uri> getDependencies() => sourceBytes.keys.toList(); | 370 List<Uri> getDependencies() => sourceBytes.keys.toList(); |
371 } | 371 } |
OLD | NEW |