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 library dart2js.diagnostic_listener; |
| 6 |
| 7 import 'dart2jslib.dart' show |
| 8 SourceSpan; |
| 9 import 'elements/elements.dart' show |
| 10 Element; |
| 11 import 'messages.dart'; |
| 12 import 'util/util.dart' show |
| 13 Spannable; |
6 | 14 |
7 abstract class DiagnosticListener { | 15 abstract class DiagnosticListener { |
8 // TODO(karlklose): rename log to something like reportInfo. | 16 // TODO(karlklose): rename log to something like reportInfo. |
9 void log(message); | 17 void log(message); |
10 | 18 |
11 void internalError(Spannable spannable, message); | 19 void internalError(Spannable spannable, message); |
12 | 20 |
13 SourceSpan spanFromSpannable(Spannable node); | 21 SourceSpan spanFromSpannable(Spannable node); |
14 | 22 |
15 void reportError(Spannable node, MessageKind errorCode, | 23 void reportError(Spannable node, MessageKind errorCode, |
16 [Map arguments = const {}]); | 24 [Map arguments = const {}]); |
17 | 25 |
18 void reportWarning(Spannable node, MessageKind errorCode, | 26 void reportWarning(Spannable node, MessageKind errorCode, |
19 [Map arguments = const {}]); | 27 [Map arguments = const {}]); |
20 | 28 |
21 void reportHint(Spannable node, MessageKind errorCode, | 29 void reportHint(Spannable node, MessageKind errorCode, |
22 [Map arguments = const {}]); | 30 [Map arguments = const {}]); |
23 | 31 |
24 void reportInfo(Spannable node, MessageKind errorCode, | 32 void reportInfo(Spannable node, MessageKind errorCode, |
25 [Map arguments = const {}]); | 33 [Map arguments = const {}]); |
26 | 34 |
27 // TODO(ahe): We should not expose this here. Perhaps a | 35 // TODO(ahe): We should not expose this here. Perhaps a |
28 // [SourceSpan] should implement [Spannable], and we should have a | 36 // [SourceSpan] should implement [Spannable], and we should have a |
29 // way to construct a [SourceSpan] from a [Spannable] and an | 37 // way to construct a [SourceSpan] from a [Spannable] and an |
30 // [Element]. | 38 // [Element]. |
31 withCurrentElement(Element element, f()); | 39 withCurrentElement(Element element, f()); |
32 } | 40 } |
OLD | NEW |