Index: pkg/front_end/lib/src/fasta/uri_translator.dart |
diff --git a/pkg/front_end/lib/src/fasta/uri_translator.dart b/pkg/front_end/lib/src/fasta/uri_translator.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c6c461874dcb8aad3671302fa26aa889fb7900a4 |
--- /dev/null |
+++ b/pkg/front_end/lib/src/fasta/uri_translator.dart |
@@ -0,0 +1,28 @@ |
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library fasta.uri_translator; |
+ |
+import 'package:front_end/file_system.dart' show FileSystem; |
+ |
+/// Instances of [UriTranslator] translate absolute URIs into corresponding |
+/// file URIs in a [FileSystem]. Translated URIs are typically `file:` URIs, |
+/// but may use a different scheme depending on the used custom file system. |
+abstract class UriTranslator { |
+ /// Return the URIs of patches that should be applied to the platform library |
+ /// with the given [libraryName], or `null` if there are no patches to apply. |
Siggi Cherem (dart-lang)
2017/07/12 17:55:23
alternatively, we could drop the "or `null`..." an
scheglov
2017/07/12 18:53:14
Yeah, I thought about this.
But then there is TODO
|
+ List<Uri> getDartPatches(String libraryName); |
+ |
+ /// Returns `true` if [uri] is private to the platform libraries (and thus |
+ /// not accessible from user code). |
+ bool isPlatformImplementation(Uri uri); |
+ |
+ /// Return the corresponding file URI for the given absolute [uri], or `null` |
+ /// if there is no corresponding file URI, or the given [uri] is already a |
+ /// file URI. |
+ /// |
+ /// This is the URIs only transformation, there is no guarantee that the |
Siggi Cherem (dart-lang)
2017/07/12 17:55:24
nit: just to make it easier to read:
"This is the
scheglov
2017/07/12 18:53:14
Done.
|
+ /// corresponding file exists in the file system. |
+ Uri translate(Uri uri); |
+} |