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

Unified Diff: lib/compiler/implementation/source_file.dart

Issue 10331010: Add support for --no-colors to make it easier to integrate dart2js in the editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add bug number. Created 8 years, 8 months 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
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/source_file.dart
diff --git a/lib/compiler/implementation/source_file.dart b/lib/compiler/implementation/source_file.dart
index 234500d58443855e0a70780e4345cc51d68920d6..b8f138f924c1c083fdb762b4dc11073fb3f68d45 100644
--- a/lib/compiler/implementation/source_file.dart
+++ b/lib/compiler/implementation/source_file.dart
@@ -4,7 +4,7 @@
#library('source_file');
-#import('colors.dart');
+#import('colors.dart', prefix: 'colors');
/**
* Represents a file of source code.
@@ -54,7 +54,7 @@ class SourceFile {
* in the file.
*/
String getLocationMessage(String message, int start,
- [int end, bool includeText=false, bool useColors = true]) {
+ [int end, bool includeText = false]) {
var line = getLine(start);
var column = getColumn(line, start);
@@ -71,11 +71,11 @@ class SourceFile {
}
int toColumn = Math.min(column + (end-start), textLine.length);
- if (useColors) {
+ if (colors.enabled) {
buf.add(textLine.substring(0, column));
- buf.add(RED_COLOR);
+ buf.add(colors.RED_COLOR);
buf.add(textLine.substring(column, toColumn));
- buf.add(NO_COLOR);
+ buf.add(colors.NO_COLOR);
buf.add(textLine.substring(toColumn));
} else {
buf.add(textLine);
@@ -86,11 +86,11 @@ class SourceFile {
buf.add(' ');
}
- if (useColors) buf.add(RED_COLOR);
+ if (colors.enabled) buf.add(colors.RED_COLOR);
for (; i < toColumn; i++) {
buf.add('^');
}
- if (useColors) buf.add(NO_COLOR);
+ if (colors.enabled) buf.add(colors.NO_COLOR);
}
return buf.toString();
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698