| 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:typed_data' show Uint8List; | 9 import 'dart:typed_data' show Uint8List; |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 Token tokens = await tokenize(part); | 119 Token tokens = await tokenize(part); |
| 120 if (tokens != null) { | 120 if (tokens != null) { |
| 121 listener.uri = part.fileUri; | 121 listener.uri = part.fileUri; |
| 122 parser.parseUnit(tokens); | 122 parser.parseUnit(tokens); |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 DietListener createDietListener(LibraryBuilder library) { | 128 DietListener createDietListener(LibraryBuilder library) { |
| 129 return new DietListener(library, hierarchy, coreTypes, | 129 var typeInferrer = target.strongMode |
| 130 new KernelTypeInferrer(coreTypes, hierarchy, instrumentation)); | 130 ? new KernelTypeInferrer(coreTypes, hierarchy, instrumentation) |
| 131 : null; |
| 132 return new DietListener(library, hierarchy, coreTypes, typeInferrer); |
| 131 } | 133 } |
| 132 | 134 |
| 133 void resolveParts() { | 135 void resolveParts() { |
| 134 List<Uri> parts = <Uri>[]; | 136 List<Uri> parts = <Uri>[]; |
| 135 builders.forEach((Uri uri, LibraryBuilder library) { | 137 builders.forEach((Uri uri, LibraryBuilder library) { |
| 136 if (library is SourceLibraryBuilder) { | 138 if (library is SourceLibraryBuilder) { |
| 137 if (library.isPart) { | 139 if (library.isPart) { |
| 138 library.validatePart(); | 140 library.validatePart(); |
| 139 parts.add(uri); | 141 parts.add(uri); |
| 140 } else { | 142 } else { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 361 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
| 360 assert(hierarchy != null); | 362 assert(hierarchy != null); |
| 361 for (SourceClassBuilder builder in sourceClasses) { | 363 for (SourceClassBuilder builder in sourceClasses) { |
| 362 builder.checkOverrides(hierarchy); | 364 builder.checkOverrides(hierarchy); |
| 363 } | 365 } |
| 364 ticker.logMs("Checked overrides"); | 366 ticker.logMs("Checked overrides"); |
| 365 } | 367 } |
| 366 | 368 |
| 367 List<Uri> getDependencies() => sourceBytes.keys.toList(); | 369 List<Uri> getDependencies() => sourceBytes.keys.toList(); |
| 368 } | 370 } |
| OLD | NEW |