Chromium Code Reviews| 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 |
| 11 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' | |
|
ahe
2017/04/18 15:49:59
Relative?
| |
| 12 show KernelTypeInferrer; | |
| 13 | |
| 11 import 'package:kernel/ast.dart' show Program; | 14 import 'package:kernel/ast.dart' show Program; |
| 12 | 15 |
| 13 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; | 16 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
| 14 | 17 |
| 15 import 'package:kernel/core_types.dart' show CoreTypes; | 18 import 'package:kernel/core_types.dart' show CoreTypes; |
| 16 | 19 |
| 17 import '../builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; | 20 import '../builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; |
| 18 | 21 |
| 19 import '../compiler_context.dart' show CompilerContext; | 22 import '../compiler_context.dart' show CompilerContext; |
| 20 | 23 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 Token tokens = await tokenize(part); | 115 Token tokens = await tokenize(part); |
| 113 if (tokens != null) { | 116 if (tokens != null) { |
| 114 listener.uri = part.fileUri; | 117 listener.uri = part.fileUri; |
| 115 parser.parseUnit(tokens); | 118 parser.parseUnit(tokens); |
| 116 } | 119 } |
| 117 } | 120 } |
| 118 } | 121 } |
| 119 } | 122 } |
| 120 | 123 |
| 121 DietListener createDietListener(LibraryBuilder library) { | 124 DietListener createDietListener(LibraryBuilder library) { |
| 122 return new DietListener(library, hierarchy, coreTypes); | 125 return new DietListener(library, hierarchy, coreTypes, |
| 126 new KernelTypeInferrer(coreTypes, hierarchy)); | |
| 123 } | 127 } |
| 124 | 128 |
| 125 void resolveParts() { | 129 void resolveParts() { |
| 126 List<Uri> parts = <Uri>[]; | 130 List<Uri> parts = <Uri>[]; |
| 127 builders.forEach((Uri uri, LibraryBuilder library) { | 131 builders.forEach((Uri uri, LibraryBuilder library) { |
| 128 if (library is SourceLibraryBuilder) { | 132 if (library is SourceLibraryBuilder) { |
| 129 if (library.isPart) { | 133 if (library.isPart) { |
| 130 library.validatePart(); | 134 library.validatePart(); |
| 131 parts.add(uri); | 135 parts.add(uri); |
| 132 } else { | 136 } else { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 351 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 355 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
| 352 assert(hierarchy != null); | 356 assert(hierarchy != null); |
| 353 for (SourceClassBuilder builder in sourceClasses) { | 357 for (SourceClassBuilder builder in sourceClasses) { |
| 354 builder.checkOverrides(hierarchy); | 358 builder.checkOverrides(hierarchy); |
| 355 } | 359 } |
| 356 ticker.logMs("Checked overrides"); | 360 ticker.logMs("Checked overrides"); |
| 357 } | 361 } |
| 358 | 362 |
| 359 List<Uri> getDependencies() => sourceBytes.keys.toList(); | 363 List<Uri> getDependencies() => sourceBytes.keys.toList(); |
| 360 } | 364 } |
| OLD | NEW |