OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.error; | 5 library engine.error; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'ast.dart' show AstNode; | 9 import 'ast.dart' show AstNode; |
10 import 'element.dart'; | 10 import 'element.dart'; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 //buffer.write("(" + lineNumber + ":" + columnNumber + "): "); | 202 //buffer.write("(" + lineNumber + ":" + columnNumber + "): "); |
203 buffer.write(_message); | 203 buffer.write(_message); |
204 return buffer.toString(); | 204 return buffer.toString(); |
205 } | 205 } |
206 | 206 |
207 /** | 207 /** |
208 * Merge all of the errors in the lists in the given list of [errorLists] into | 208 * Merge all of the errors in the lists in the given list of [errorLists] into |
209 * a single list of errors. | 209 * a single list of errors. |
210 */ | 210 */ |
211 static List<AnalysisError> mergeLists(List<List<AnalysisError>> errorLists) { | 211 static List<AnalysisError> mergeLists(List<List<AnalysisError>> errorLists) { |
212 List<AnalysisError> errors = <AnalysisError>[]; | 212 Set<AnalysisError> errors = new HashSet<AnalysisError>(); |
213 for (List<AnalysisError> errorList in errorLists) { | 213 for (List<AnalysisError> errorList in errorLists) { |
214 errors.addAll(errorList); | 214 errors.addAll(errorList); |
215 } | 215 } |
216 return errors; | 216 return errors.toList(); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 /** | 220 /** |
221 * An object that listen for [AnalysisError]s being produced by the analysis | 221 * An object that listen for [AnalysisError]s being produced by the analysis |
222 * engine. | 222 * engine. |
223 */ | 223 */ |
224 abstract class AnalysisErrorListener { | 224 abstract class AnalysisErrorListener { |
225 /** | 225 /** |
226 * An error listener that ignores errors that are reported to it. | 226 * An error listener that ignores errors that are reported to it. |
(...skipping 4711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4938 * Initialize a newly created error code to have the given [name]. | 4938 * Initialize a newly created error code to have the given [name]. |
4939 */ | 4939 */ |
4940 const TodoCode(String name) : super(name, "{0}"); | 4940 const TodoCode(String name) : super(name, "{0}"); |
4941 | 4941 |
4942 @override | 4942 @override |
4943 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 4943 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
4944 | 4944 |
4945 @override | 4945 @override |
4946 ErrorType get type => ErrorType.TODO; | 4946 ErrorType get type => ErrorType.TODO; |
4947 } | 4947 } |
OLD | NEW |