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

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

Issue 2880453005: Build up and pass MemoryFileSystem to fasta frontend. (Closed)
Patch Set: Use integer division 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') | no next file with comments »
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 f6a9a5f0f42dc34ac0629db1dd6990e0e7d13ff4..0350834b0c1f4d67445278d24d3e83af0a3b5e5d 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698