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

Unified Diff: pkg/analyzer/lib/src/task/options.dart

Issue 1744773002: Support conditional directives in the options file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/options.dart
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index 9b96c6a9bf0f81db3236fd8d89bb76385720400a..e5989105aef0c14db2e1d3ae09b87c9ca1e96c2b 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -47,6 +47,8 @@ class AnalyzerOptions {
static const String enableAsync = 'enableAsync';
static const String enableGenericMethods = 'enableGenericMethods';
static const String enableSuperMixins = 'enableSuperMixins';
+ static const String enableConditionalDirectives =
+ "enableConditionalDirectives";
static const String errors = 'errors';
static const String exclude = 'exclude';
static const String language = 'language';
@@ -79,7 +81,8 @@ class AnalyzerOptions {
static const List<String> languageOptions = const [
enableAsync,
enableGenericMethods,
- enableSuperMixins
+ enableSuperMixins,
+ enableConditionalDirectives,
];
}
@@ -490,6 +493,14 @@ class _OptionsProcessor {
context.analysisOptions = options;
}
}
+ if (feature == AnalyzerOptions.enableConditionalDirectives) {
+ if (isTrue(value)) {
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.from(context.analysisOptions);
+ options.enableConditionalDirectives = true;
+ context.analysisOptions = options;
+ }
+ }
}
void setLanguageOptions(AnalysisContext context, Object configs) {
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698