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