Index: pkg/analyzer/lib/src/fasta/analyzer_target.dart |
diff --git a/pkg/analyzer/lib/src/fasta/analyzer_target.dart b/pkg/analyzer/lib/src/fasta/analyzer_target.dart |
index 572dbc3cf82a4fac2a8855ac2881ec963be56278..a940559c67659ce4428b391699d5ce5a342f0b16 100644 |
--- a/pkg/analyzer/lib/src/fasta/analyzer_target.dart |
+++ b/pkg/analyzer/lib/src/fasta/analyzer_target.dart |
@@ -17,12 +17,35 @@ import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget; |
import 'analyzer_loader.dart' show AnalyzerLoader; |
class AnalyzerTarget extends KernelTarget { |
- AnalyzerTarget( |
- DillTarget dillTarget, UriTranslator uriTranslator, bool strongMode, |
+ /// Indicates whether a kernel representation of the code should be generated. |
+ /// |
+ /// When `false`, an analyzer AST is generated, and type inference is copied |
+ /// over to it, but the result is not converted to a kernel representation. |
+ /// |
+ /// TODO(paulberry): remove this once "kompile" functionality is no longer |
+ /// needed. |
+ final bool generateKernel; |
+ |
+ /// Indicates whether a resolved AST should be generated. |
+ /// |
+ /// When `false`, an analyzer AST is generated, but none of the types or |
+ /// elements pointed to by the AST are guaranteed to be correct. |
+ /// |
+ /// This is needed in order to support the old "kompile" use case, since the |
+ /// tests of that functionality were based on the behavior prior to |
+ /// integrating resolution and type inference with analyzer. |
+ /// |
+ /// TODO(paulberry): remove this once "kompile" functionality is no longer |
+ /// needed. |
+ final bool doResolution; |
+ |
+ AnalyzerTarget(DillTarget dillTarget, UriTranslator uriTranslator, |
+ bool strongMode, this.generateKernel, this.doResolution, |
[Map<String, Source> uriToSource]) |
: super(PhysicalFileSystem.instance, dillTarget, uriTranslator, |
uriToSource); |
@override |
- AnalyzerLoader<Library> createLoader() => new AnalyzerLoader<Library>(this); |
+ AnalyzerLoader<Library> createLoader() => |
+ new AnalyzerLoader<Library>(this, generateKernel, doResolution); |
} |