Index: frog/world.dart |
diff --git a/frog/world.dart b/frog/world.dart |
index 2254ffb9542515f15d8f3e8eded2e0d5c066a122..dff2803f3780b1650ac537be3cd1e7a3214536bf 100644 |
--- a/frog/world.dart |
+++ b/frog/world.dart |
@@ -406,33 +406,42 @@ class World { |
} |
/** [message] is considered a static compile-time error by the Dart lang. */ |
- void error(String message, [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
+ void error(String message, |
+ [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
errors++; |
- _message('error: $message', span, span1, span2, options.throwOnErrors); |
+ _message(options.useColors |
+ ? '${_RED_COLOR}error$_NO_COLOR: $message' : 'error: $message', |
Bob Nystrom
2011/12/06 22:47:43
This seems a bit redundant. How about having _mess
Siggi Cherem (dart-lang)
2011/12/06 23:37:38
Done.
|
+ span, span1, span2, options.throwOnErrors); |
} |
/** [message] is considered a type warning by the Dart lang. */ |
- void warning(String message, [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
+ void warning(String message, |
+ [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
if (options.warningsAsErrors) { |
error(message, span, span1, span2); |
return; |
} |
warnings++; |
if (options.showWarnings) { |
- _message('warning: $message', span, span1, span2, options.throwOnWarnings); |
+ _message(options.useColors |
+ ? '${_MAGENTA_COLOR}warning$_NO_COLOR: $message' |
+ : 'warning: $message', span, span1, span2, options.throwOnWarnings); |
} |
} |
/** [message] at [location] is so bad we can't generate runnable code. */ |
- void fatal(String message, [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
+ void fatal(String message, |
+ [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
errors++; |
seenFatal = true; |
- _message('fatal: $message', span, span1, span2, |
- options.throwOnFatal || options.throwOnErrors); |
+ _message(options.useColors |
+ ? '${_RED_COLOR}fatal$_NO_COLOR: $message' : 'fatal: $message', |
+ span, span1, span2, options.throwOnFatal || options.throwOnErrors); |
} |
/** [message] at [location] is about a bug in the compiler. */ |
- void internalError(String message, [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
+ void internalError(String message, |
+ [SourceSpan span, SourceSpan span1, SourceSpan span2]) { |
_message('We are sorry, but... $message', span, span1, span2, true); |
} |