Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: frog/world.dart

Issue 8823010: frog: life is better with colors :) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698