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

Unified Diff: pkg/front_end/lib/src/base/processed_options.dart

Issue 2869563002: Initial version of Fasta based IncrementalKernelGenerator. (Closed)
Patch Set: Add mock SDK. 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
Index: pkg/front_end/lib/src/base/processed_options.dart
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index 60ef2ecfb12e39747976ee61f117841c46db4b7f..2973bc2e619d93c98094e33cfe631e330a028494 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -7,7 +7,7 @@ import 'dart:async';
import 'package:analyzer/src/summary/idl.dart';
import 'package:front_end/compiler_options.dart';
import 'package:front_end/file_system.dart';
-import 'package:front_end/src/base/uri_resolver.dart';
+import 'package:front_end/src/fasta/translate_uri.dart';
Siggi Cherem (dart-lang) 2017/05/08 17:44:29 a very low priority comment - nothing to do on thi
import 'package:package_config/packages_file.dart' as package_config;
/// Wrapper around [CompilerOptions] which exposes the options in a form useful
@@ -26,9 +26,9 @@ class ProcessedOptions {
/// not been computed yet.
Map<String, Uri> _packages;
- /// A URI resolver based on the options, or `null` if the URI resolver has not
- /// been computed yet.
- UriResolver _uriResolver;
+ /// The object that knows how to resolve "package:" and "dart:" URIs,
+ /// or `null` if it has not been computed yet.
+ TranslateUri _uriTranslator;
/// The summary bundle for the SDK, or `null` if it has not been read yet.
PackageBundle _sdkSummary;
@@ -55,6 +55,9 @@ class ProcessedOptions {
return _raw.fileSystem;
}
+ /// Whether to interpret Dart sources in strong-mode.
+ bool get strongMode => _raw.strongMode;
+
/// Get the summary bundle for the SDK.
///
/// This is an asynchronous getter since file system operations are required.
@@ -79,18 +82,19 @@ class ProcessedOptions {
return _sdkSummary;
}
- /// Get the [UriResolver] which resolves "package:" and "dart:" URIs.
+ /// Get the [TranslateUri] which resolves "package:" and "dart:" URIs.
///
- /// This is an asynchronous getter since file system operations may be
+ /// This is an asynchronous method since file system operations may be
/// required to locate/read the packages file as well as SDK metadata.
- Future<UriResolver> getUriResolver() async {
- if (_uriResolver == null) {
+ Future<TranslateUri> getUriTranslator() async {
+ if (_uriTranslator == null) {
await _getPackages();
- var sdkLibraries =
- <String, Uri>{}; // TODO(paulberry): support SDK libraries
- _uriResolver = new UriResolver(_packages, sdkLibraries);
+ // TODO(scheglov) Load SDK libraries from whatever format we decide.
+ // TODO(scheglov) Remove the field "_raw.dartLibraries".
+ _uriTranslator = new TranslateUri(_packages, _raw.dartLibraries);
+ _uriTranslator.dartLibraries.addAll(_raw.dartLibraries);
}
- return _uriResolver;
+ return _uriTranslator;
}
/// Get the package map which maps package names to URIs.

Powered by Google App Engine
This is Rietveld 408576698