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

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

Issue 10579015: Update dart2js to use diagnostic kinds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 | « dart/lib/compiler/implementation/leg.dart ('k') | dart/tests/utils/dummy_compiler_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/source_file.dart
diff --git a/dart/lib/compiler/implementation/source_file.dart b/dart/lib/compiler/implementation/source_file.dart
index 884d00854d181dd6172513dab2d0f4e820410609..276b0fe5d2af924297cf49f770fdcf8a5e6e75c5 100644
--- a/dart/lib/compiler/implementation/source_file.dart
+++ b/dart/lib/compiler/implementation/source_file.dart
@@ -53,8 +53,8 @@ class SourceFile {
* Create a pretty string representation from a character position
* in the file.
*/
- String getLocationMessage(String message, int start,
- [int end, bool includeText = false]) {
+ String getLocationMessage(String message, int start, int end,
+ bool includeText, String color(String x)) {
var line = getLine(start);
var column = getColumn(line, start);
@@ -71,26 +71,18 @@ class SourceFile {
}
int toColumn = Math.min(column + (end-start), textLine.length);
- if (colors.enabled) {
- buf.add(textLine.substring(0, column));
- buf.add(colors.RED_COLOR);
- buf.add(textLine.substring(column, toColumn));
- buf.add(colors.NO_COLOR);
- buf.add(textLine.substring(toColumn));
- } else {
- buf.add(textLine);
- }
+ buf.add(textLine.substring(0, column));
+ buf.add(color(textLine.substring(column, toColumn)));
+ buf.add(textLine.substring(toColumn));
int i = 0;
for (; i < column; i++) {
buf.add(' ');
}
- if (colors.enabled) buf.add(colors.RED_COLOR);
for (; i < toColumn; i++) {
- buf.add('^');
+ buf.add(color('^'));
}
- if (colors.enabled) buf.add(colors.NO_COLOR);
}
return buf.toString();
« no previous file with comments | « dart/lib/compiler/implementation/leg.dart ('k') | dart/tests/utils/dummy_compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698