OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer_cli.src.options; | 5 library analyzer_cli.src.options; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer_cli/src/driver.dart'; | 9 import 'package:analyzer_cli/src/driver.dart'; |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 /// A table mapping the names of defined variables to their values. | 81 /// A table mapping the names of defined variables to their values. |
82 final Map<String, String> definedVariables; | 82 final Map<String, String> definedVariables; |
83 | 83 |
84 /// Whether to report hints | 84 /// Whether to report hints |
85 final bool disableHints; | 85 final bool disableHints; |
86 | 86 |
87 /// Whether to display version information | 87 /// Whether to display version information |
88 final bool displayVersion; | 88 final bool displayVersion; |
89 | 89 |
| 90 /// A flag indicating whether access to field formal parameters should be |
| 91 /// allowed in a constructor's initializer list. |
| 92 final bool enableInitializingFormalAccess; |
| 93 |
90 /// Whether to enable null-aware operators (DEP 9). | 94 /// Whether to enable null-aware operators (DEP 9). |
91 final bool enableNullAwareOperators; | 95 final bool enableNullAwareOperators; |
92 | 96 |
93 /// Whether to strictly follow the specification when generating warnings on | 97 /// Whether to strictly follow the specification when generating warnings on |
94 /// "call" methods (fixes dartbug.com/21938). | 98 /// "call" methods (fixes dartbug.com/21938). |
95 final bool enableStrictCallChecks; | 99 final bool enableStrictCallChecks; |
96 | 100 |
97 /// Whether to relax restrictions on mixins (DEP 34). | 101 /// Whether to relax restrictions on mixins (DEP 34). |
98 final bool enableSuperMixins; | 102 final bool enableSuperMixins; |
99 | 103 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 args['build-summary-exclude-informative'], | 178 args['build-summary-exclude-informative'], |
175 buildSummaryOutput = args['build-summary-output'], | 179 buildSummaryOutput = args['build-summary-output'], |
176 buildSummaryOutputSemantic = args['build-summary-output-semantic'], | 180 buildSummaryOutputSemantic = args['build-summary-output-semantic'], |
177 buildSuppressExitCode = args['build-suppress-exit-code'], | 181 buildSuppressExitCode = args['build-suppress-exit-code'], |
178 dartSdkPath = args['dart-sdk'], | 182 dartSdkPath = args['dart-sdk'], |
179 dartSdkSummaryPath = args['dart-sdk-summary'], | 183 dartSdkSummaryPath = args['dart-sdk-summary'], |
180 definedVariables = definedVariables, | 184 definedVariables = definedVariables, |
181 analysisOptionsFile = args['options'], | 185 analysisOptionsFile = args['options'], |
182 disableHints = args['no-hints'], | 186 disableHints = args['no-hints'], |
183 displayVersion = args['version'], | 187 displayVersion = args['version'], |
| 188 enableInitializingFormalAccess = args['initializing-formal-access'], |
184 enableNullAwareOperators = args['enable-null-aware-operators'], | 189 enableNullAwareOperators = args['enable-null-aware-operators'], |
185 enableStrictCallChecks = args['enable-strict-call-checks'], | 190 enableStrictCallChecks = args['enable-strict-call-checks'], |
186 enableSuperMixins = args['supermixin'], | 191 enableSuperMixins = args['supermixin'], |
187 enableTypeChecks = args['enable_type_checks'], | 192 enableTypeChecks = args['enable_type_checks'], |
188 hintsAreFatal = args['fatal-hints'], | 193 hintsAreFatal = args['fatal-hints'], |
189 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 194 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
190 lints = args['lints'], | 195 lints = args['lints'], |
191 log = args['log'], | 196 log = args['log'], |
192 machineFormat = args['machine'] || args['format'] == 'machine', | 197 machineFormat = args['machine'] || args['format'] == 'machine', |
193 incrementalCachePath = args['incremental-cache-path'], | 198 incrementalCachePath = args['incremental-cache-path'], |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 ..addFlag('enable-strict-call-checks', | 468 ..addFlag('enable-strict-call-checks', |
464 help: 'Fix issue 21938.', | 469 help: 'Fix issue 21938.', |
465 defaultsTo: false, | 470 defaultsTo: false, |
466 negatable: false, | 471 negatable: false, |
467 hide: true) | 472 hide: true) |
468 ..addFlag('enable-new-task-model', | 473 ..addFlag('enable-new-task-model', |
469 help: 'deprecated -- Ennable new task model.', | 474 help: 'deprecated -- Ennable new task model.', |
470 defaultsTo: false, | 475 defaultsTo: false, |
471 negatable: false, | 476 negatable: false, |
472 hide: true) | 477 hide: true) |
| 478 ..addFlag('initializing-formal-access', |
| 479 help: |
| 480 'Enable support for allowing access to field formal parameters in
a constructor\'s initializer list', |
| 481 defaultsTo: false, |
| 482 negatable: false, |
| 483 hide: true) |
473 ..addFlag('supermixin', | 484 ..addFlag('supermixin', |
474 help: 'Relax restrictions on mixins (DEP 34).', | 485 help: 'Relax restrictions on mixins (DEP 34).', |
475 defaultsTo: false, | 486 defaultsTo: false, |
476 negatable: false, | 487 negatable: false, |
477 hide: true) | 488 hide: true) |
478 ..addFlag('log', | 489 ..addFlag('log', |
479 help: 'Log additional messages and exceptions.', | 490 help: 'Log additional messages and exceptions.', |
480 defaultsTo: false, | 491 defaultsTo: false, |
481 negatable: false, | 492 negatable: false, |
482 hide: true) | 493 hide: true) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 | 719 |
709 int _getNextFlagIndex(args, i) { | 720 int _getNextFlagIndex(args, i) { |
710 for (; i < args.length; ++i) { | 721 for (; i < args.length; ++i) { |
711 if (args[i].startsWith('--')) { | 722 if (args[i].startsWith('--')) { |
712 return i; | 723 return i; |
713 } | 724 } |
714 } | 725 } |
715 return i; | 726 return i; |
716 } | 727 } |
717 } | 728 } |
OLD | NEW |