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

Unified Diff: packages/source_span/lib/src/span.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/source_span/lib/src/location_mixin.dart ('k') | packages/source_span/lib/src/span_exception.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/source_span/lib/src/span.dart
diff --git a/packages/source_span/lib/src/span.dart b/packages/source_span/lib/src/span.dart
index 9f150482c6da354adbbad9753a12a306b4bf432c..599d6680651d9c9c2b6af92f6e58fe69ccd4d630 100644
--- a/packages/source_span/lib/src/span.dart
+++ b/packages/source_span/lib/src/span.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library source_span.span;
-
import 'location.dart';
import 'span_mixin.dart';
@@ -55,6 +53,19 @@ abstract class SourceSpan implements Comparable<SourceSpan> {
/// should be highlighted using the default color. If it's `false` or `null`,
/// it indicates that the text shouldn't be highlighted.
String message(String message, {color});
+
+ /// Prints the text associated with this span in a user-friendly way.
+ ///
+ /// This is identical to [message], except that it doesn't print the file
+ /// name, line number, column number, or message. If [length] is 0 and this
+ /// isn't a [SourceSpanWithContext], returns an empty string.
+ ///
+ /// [color] may either be a [String], a [bool], or `null`. If it's a string,
+ /// it indicates an ANSII terminal color escape that should be used to
+ /// highlight the span's text. If it's `true`, it indicates that the text
+ /// should be highlighted using the default color. If it's `false` or `null`,
+ /// it indicates that the text shouldn't be highlighted.
+ String highlight({color});
}
/// A base class for source spans with [start], [end], and [text] known at
« no previous file with comments | « packages/source_span/lib/src/location_mixin.dart ('k') | packages/source_span/lib/src/span_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698