Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2225)

Unified Diff: pkg/front_end/lib/src/fasta/fasta.dart

Issue 2880453005: Build up and pass MemoryFileSystem to fasta frontend. (Closed)
Patch Set: Merge branch 'master' of github.com:dart-lang/sdk into build-memory-fs Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/vm.dart » ('j') | utils/kernel-service/kernel-service.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/fasta.dart
diff --git a/pkg/front_end/lib/src/fasta/fasta.dart b/pkg/front_end/lib/src/fasta/fasta.dart
index db0b740b2d8b773c38b263ba1a378df3e61934ee..d4dc5356b86465b701fc22f9c490cad49d39a34d 100644
--- a/pkg/front_end/lib/src/fasta/fasta.dart
+++ b/pkg/front_end/lib/src/fasta/fasta.dart
@@ -164,8 +164,16 @@ class CompileTask {
Future<CompilationResult> parseScript(
Uri fileName, Uri packages, Uri patchedSdk,
{bool verbose: false, bool strongMode: false}) async {
+ return parseScriptInFileSystem(
+ fileName, PhysicalFileSystem.instance, packages, patchedSdk,
+ verbose: verbose, strongMode: strongMode);
+}
+
+Future<CompilationResult> parseScriptInFileSystem(
+ Uri fileName, FileSystem fileSystem, Uri packages, Uri patchedSdk,
+ {bool verbose: false, bool strongMode: false}) async {
try {
- if (!await new File.fromUri(fileName).exists()) {
+ if (!await fileSystem.entityForUri(fileName).exists()) {
return new CompilationResult.error(
formatUnexpected(fileName, -1, "No such file."));
}
@@ -177,12 +185,12 @@ Future<CompilationResult> parseScript(
Program program;
try {
TranslateUri uriTranslator =
- await TranslateUri.parse(PhysicalFileSystem.instance, null, packages);
+ await TranslateUri.parse(fileSystem, null, packages);
final Ticker ticker = new Ticker(isVerbose: verbose);
final DillTarget dillTarget = new DillTarget(ticker, uriTranslator);
_appendDillForUri(dillTarget, patchedSdk.resolve('platform.dill'));
- final KernelTarget kernelTarget = new KernelTarget(
- PhysicalFileSystem.instance, dillTarget, uriTranslator, strongMode);
+ final KernelTarget kernelTarget =
+ new KernelTarget(fileSystem, dillTarget, uriTranslator, strongMode);
kernelTarget.read(fileName);
await dillTarget.writeOutline(null);
program = await kernelTarget.writeOutline(null);
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/vm.dart » ('j') | utils/kernel-service/kernel-service.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698