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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 buffer.write((source != null) ? source.fullName : "<unknown source>"); | 184 buffer.write((source != null) ? source.fullName : "<unknown source>"); |
185 buffer.write("("); | 185 buffer.write("("); |
186 buffer.write(offset); | 186 buffer.write(offset); |
187 buffer.write(".."); | 187 buffer.write(".."); |
188 buffer.write(offset + _length - 1); | 188 buffer.write(offset + _length - 1); |
189 buffer.write("): "); | 189 buffer.write("): "); |
190 //buffer.write("(" + lineNumber + ":" + columnNumber + "): "); | 190 //buffer.write("(" + lineNumber + ":" + columnNumber + "): "); |
191 buffer.write(_message); | 191 buffer.write(_message); |
192 return buffer.toString(); | 192 return buffer.toString(); |
193 } | 193 } |
194 | |
195 /** | |
196 * Merge all of the errors in the lists in the given list of [errorLists] into | |
197 * a single list of errors. | |
198 */ | |
199 static List<AnalysisError> mergeLists(List<List<AnalysisError>> errorLists) { | |
200 List<AnalysisError> errors = <AnalysisError>[]; | |
201 for (List<AnalysisError> errorList in errorLists) { | |
202 errors.addAll(errorList); | |
203 } | |
204 return errors; | |
scheglov
2015/05/07 18:11:38
It could be also implemented as:
errorLists.expan
Brian Wilkerson
2015/05/07 18:30:07
I think I'll leave it, then.
| |
205 } | |
194 } | 206 } |
195 | 207 |
196 /** | 208 /** |
197 * An object that listen for [AnalysisError]s being produced by the analysis | 209 * An object that listen for [AnalysisError]s being produced by the analysis |
198 * engine. | 210 * engine. |
199 */ | 211 */ |
200 abstract class AnalysisErrorListener { | 212 abstract class AnalysisErrorListener { |
201 /** | 213 /** |
202 * An error listener that ignores errors that are reported to it. | 214 * An error listener that ignores errors that are reported to it. |
203 */ | 215 */ |
(...skipping 4689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4893 * Initialize a newly created error code to have the given [name]. | 4905 * Initialize a newly created error code to have the given [name]. |
4894 */ | 4906 */ |
4895 const TodoCode(String name) : super(name, "{0}"); | 4907 const TodoCode(String name) : super(name, "{0}"); |
4896 | 4908 |
4897 @override | 4909 @override |
4898 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 4910 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
4899 | 4911 |
4900 @override | 4912 @override |
4901 ErrorType get type => ErrorType.TODO; | 4913 ErrorType get type => ErrorType.TODO; |
4902 } | 4914 } |
OLD | NEW |