OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 api.Diagnostic.WARNING); | 1148 api.Diagnostic.WARNING); |
1149 } | 1149 } |
1150 | 1150 |
1151 void reportInfo(Spannable node, MessageKind errorCode, | 1151 void reportInfo(Spannable node, MessageKind errorCode, |
1152 [Map arguments = const {}]) { | 1152 [Map arguments = const {}]) { |
1153 reportMessage(spanFromSpannable(node), | 1153 reportMessage(spanFromSpannable(node), |
1154 errorCode.error(arguments), | 1154 errorCode.error(arguments), |
1155 api.Diagnostic.INFO); | 1155 api.Diagnostic.INFO); |
1156 } | 1156 } |
1157 | 1157 |
| 1158 void reportLint(Spannable node, MessageKind errorCode, |
| 1159 [Map arguments = const {}]) { |
| 1160 reportMessage(spanFromSpannable(node), |
| 1161 errorCode.error(arguments), |
| 1162 api.Diagnostic.LINT); |
| 1163 } |
| 1164 |
1158 void reportInternalError(Spannable node, String message) { | 1165 void reportInternalError(Spannable node, String message) { |
1159 reportMessage(spanFromSpannable(node), | 1166 reportMessage(spanFromSpannable(node), |
1160 MessageKind.GENERIC.error({'text': message}), | 1167 MessageKind.GENERIC.error({'text': message}), |
1161 api.Diagnostic.ERROR); | 1168 api.Diagnostic.ERROR); |
1162 } | 1169 } |
1163 | 1170 |
1164 void reportMessage(SourceSpan span, Diagnostic message, api.Diagnostic kind) { | 1171 void reportMessage(SourceSpan span, Diagnostic message, api.Diagnostic kind) { |
1165 // TODO(ahe): The names Diagnostic and api.Diagnostic are in | 1172 // TODO(ahe): The names Diagnostic and api.Diagnostic are in |
1166 // conflict. Fix it. | 1173 // conflict. Fix it. |
1167 reportDiagnostic(span, "$message", kind); | 1174 reportDiagnostic(span, "$message", kind); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 | 1439 |
1433 void close() {} | 1440 void close() {} |
1434 | 1441 |
1435 toString() => name; | 1442 toString() => name; |
1436 | 1443 |
1437 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1444 /// Convenience method for getting an [api.CompilerOutputProvider]. |
1438 static NullSink outputProvider(String name, String extension) { | 1445 static NullSink outputProvider(String name, String extension) { |
1439 return new NullSink('$name.$extension'); | 1446 return new NullSink('$name.$extension'); |
1440 } | 1447 } |
1441 } | 1448 } |
OLD | NEW |