Chromium Code Reviews| Index: pkg/analyzer/lib/src/command_line/arguments.dart |
| diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart |
| index 5ea958eaad61039d80ed01c1b813ad1fd3ed6675..c791f725f868c02a5a0213de01a9241e9c41130b 100644 |
| --- a/pkg/analyzer/lib/src/command_line/arguments.dart |
| +++ b/pkg/analyzer/lib/src/command_line/arguments.dart |
| @@ -18,7 +18,7 @@ const String analysisOptionsFileOption = 'options'; |
| const String defineVariableOption = 'D'; |
| const String enableInitializingFormalAccessFlag = 'initializing-formal-access'; |
| const String enableStrictCallChecksFlag = 'enable-strict-call-checks'; |
| -const String enableSuperInMixinFlag = 'supermixin'; |
| +const String enableSuperMixinFlag = 'supermixin'; |
| const String ignoreUnrecognizedFlagsFlag = 'ignore-unrecognized-flags'; |
| const String noImplicitCastsFlag = 'no-implicit-casts'; |
| const String noImplicitDynamicFlag = 'no-implicit-dynamic'; |
| @@ -29,11 +29,36 @@ const String sdkSummaryPathOption = 'dart-sdk-summary'; |
| const String strongModeFlag = 'strong'; |
| /** |
| + * Update [options] with the value of each analysis option command line flag, |
|
Brian Wilkerson
2016/12/21 21:48:06
"," --> "."
danrubel
2016/12/23 01:32:03
Done.
|
| + */ |
| +void applyAnalysisOptionFlags(AnalysisOptions options, ArgResults args) { |
|
Brian Wilkerson
2016/12/21 21:48:06
Something to consider: The only call site I see is
danrubel
2016/12/23 01:32:03
Good point. Done.
|
| + if (args.wasParsed(enableStrictCallChecksFlag)) { |
| + (options as AnalysisOptionsImpl).enableStrictCallChecks = |
| + args[enableStrictCallChecksFlag]; |
| + } |
| + if (args.wasParsed(enableSuperMixinFlag)) { |
| + (options as AnalysisOptionsImpl).enableSuperMixins = |
| + args[enableSuperMixinFlag]; |
| + } |
| + if (args.wasParsed(noImplicitCastsFlag)) { |
| + (options as AnalysisOptionsImpl).implicitCasts = !args[noImplicitCastsFlag]; |
| + } |
| + if (args.wasParsed(noImplicitDynamicFlag)) { |
| + (options as AnalysisOptionsImpl).implicitDynamic = |
| + !args[noImplicitDynamicFlag]; |
| + } |
| + if (args.wasParsed(strongModeFlag)) { |
| + (options as AnalysisOptionsImpl).strongMode = args[strongModeFlag]; |
| + } |
| +} |
| + |
| +/** |
| * Use the given [resourceProvider], [contentCache] and command-line [args] to |
| * create a context builder. |
| */ |
| ContextBuilderOptions createContextBuilderOptions(ArgResults args) { |
| ContextBuilderOptions builderOptions = new ContextBuilderOptions(); |
| + builderOptions.argResults = args; |
| // |
| // File locations. |
| // |
| @@ -46,11 +71,7 @@ ContextBuilderOptions createContextBuilderOptions(ArgResults args) { |
| // Analysis options. |
| // |
| AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl(); |
| - defaultOptions.enableStrictCallChecks = args[enableStrictCallChecksFlag]; |
| - defaultOptions.enableSuperMixins = args[enableSuperInMixinFlag]; |
| - defaultOptions.implicitCasts = !args[noImplicitCastsFlag]; |
| - defaultOptions.implicitDynamic = !args[noImplicitDynamicFlag]; |
| - defaultOptions.strongMode = args[strongModeFlag]; |
| + applyAnalysisOptionFlags(defaultOptions, args); |
| builderOptions.defaultOptions = defaultOptions; |
| // |
| // Declared variables. |
| @@ -163,7 +184,7 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) { |
| defaultsTo: false, |
| negatable: false, |
| hide: hide || ddc); |
| - parser.addFlag(enableSuperInMixinFlag, |
| + parser.addFlag(enableSuperMixinFlag, |
| help: 'Relax restrictions on mixins (DEP 34).', |
| defaultsTo: false, |
| negatable: false, |