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.src.task.options; | 5 library analyzer.src.task.options; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
10 import 'package:analyzer/plugin/options.dart'; | 10 import 'package:analyzer/plugin/options.dart'; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 StringUtilities.printListOfQuotedNames(legalValues); | 166 StringUtilities.printListOfQuotedNames(legalValues); |
167 | 167 |
168 /// Lazily populated set of error codes (hashed for speedy lookup). | 168 /// Lazily populated set of error codes (hashed for speedy lookup). |
169 static HashSet<String> _errorCodes; | 169 static HashSet<String> _errorCodes; |
170 | 170 |
171 /// Legal error code names. | 171 /// Legal error code names. |
172 static Set<String> get errorCodes { | 172 static Set<String> get errorCodes { |
173 if (_errorCodes == null) { | 173 if (_errorCodes == null) { |
174 _errorCodes = new HashSet<String>(); | 174 _errorCodes = new HashSet<String>(); |
175 // Engine codes. | 175 // Engine codes. |
176 _errorCodes.addAll(ErrorCode.values.map((ErrorCode code) => code.name)); | 176 _errorCodes.addAll(errorCodeValues.map((ErrorCode code) => code.name)); |
177 } | 177 } |
178 return _errorCodes; | 178 return _errorCodes; |
179 } | 179 } |
180 | 180 |
181 @override | 181 @override |
182 void validate(ErrorReporter reporter, Map<String, YamlNode> options) { | 182 void validate(ErrorReporter reporter, Map<String, YamlNode> options) { |
183 var analyzer = options[AnalyzerOptions.analyzer]; | 183 var analyzer = options[AnalyzerOptions.analyzer]; |
184 if (analyzer is YamlMap) { | 184 if (analyzer is YamlMap) { |
185 var filters = analyzer[AnalyzerOptions.errors]; | 185 var filters = analyzer[AnalyzerOptions.errors]; |
186 if (filters is YamlMap) { | 186 if (filters is YamlMap) { |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 } | 612 } |
613 }); | 613 }); |
614 } else if (config is Map) { | 614 } else if (config is Map) { |
615 options.strongMode = true; | 615 options.strongMode = true; |
616 config.forEach((k, v) => _applyStrongModeOption(options, k, v)); | 616 config.forEach((k, v) => _applyStrongModeOption(options, k, v)); |
617 } else { | 617 } else { |
618 options.strongMode = config is bool ? config : false; | 618 options.strongMode = config is bool ? config : false; |
619 } | 619 } |
620 } | 620 } |
621 } | 621 } |
OLD | NEW |