| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 error_formatter; | 5 library error_formatter; |
| 6 | 6 |
| 7 import 'generated/engine.dart'; | 7 import 'generated/engine.dart'; |
| 8 import 'generated/error.dart'; | 8 import 'generated/error.dart'; |
| 9 import 'generated/source_io.dart'; | 9 import 'generated/source_io.dart'; |
| 10 import '../options.dart'; | 10 import '../options.dart'; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ErrorSeverity severity = AnalyzerImpl.computeSeverity( | 128 ErrorSeverity severity = AnalyzerImpl.computeSeverity( |
| 129 error, options.enableTypeChecks); | 129 error, options.enableTypeChecks); |
| 130 if (options.machineFormat) { | 130 if (options.machineFormat) { |
| 131 if (severity == ErrorSeverity.WARNING && options.warningsAreFatal) { | 131 if (severity == ErrorSeverity.WARNING && options.warningsAreFatal) { |
| 132 severity = ErrorSeverity.ERROR; | 132 severity = ErrorSeverity.ERROR; |
| 133 } | 133 } |
| 134 out.write(severity); | 134 out.write(severity); |
| 135 out.write('|'); | 135 out.write('|'); |
| 136 out.write(error.errorCode.type); | 136 out.write(error.errorCode.type); |
| 137 out.write('|'); | 137 out.write('|'); |
| 138 out.write(error.errorCode); | 138 out.write(error.errorCode.name); |
| 139 out.write('|'); | 139 out.write('|'); |
| 140 out.write(escapePipe(source.fullName)); | 140 out.write(escapePipe(source.fullName)); |
| 141 out.write('|'); | 141 out.write('|'); |
| 142 out.write(location.lineNumber); | 142 out.write(location.lineNumber); |
| 143 out.write('|'); | 143 out.write('|'); |
| 144 out.write(location.columnNumber); | 144 out.write(location.columnNumber); |
| 145 out.write('|'); | 145 out.write('|'); |
| 146 out.write(length); | 146 out.write(length); |
| 147 out.write('|'); | 147 out.write('|'); |
| 148 out.write(escapePipe(error.message)); | 148 out.write(escapePipe(error.message)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 static String pluralize(String word, int count) { | 173 static String pluralize(String word, int count) { |
| 174 if (count == 1) { | 174 if (count == 1) { |
| 175 return word; | 175 return word; |
| 176 } else { | 176 } else { |
| 177 return word + "s"; | 177 return word + "s"; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 } | 180 } |
| OLD | NEW |