Index: lib/src/location.dart |
diff --git a/lib/src/location.dart b/lib/src/location.dart |
index 024c6e2780a340d4eddcc2cefa3094d6c95606b8..afb37c768c97e4018075c094cea1eae25ed1adaf 100644 |
--- a/lib/src/location.dart |
+++ b/lib/src/location.dart |
@@ -6,7 +6,13 @@ library source_span.location; |
import 'span.dart'; |
-// A class that describes a single location within a source file. |
+// TODO(nweiz): Use SourceLocationMixin once we decide to cut a release with |
+// breaking changes. See SourceLocationMixin for details. |
+ |
+/// A class that describes a single location within a source file. |
+/// |
+/// This class should not be extended. Instead, [SourceLocationBase] should be |
+/// extended instead. |
class SourceLocation implements Comparable<SourceLocation> { |
/// URL of the source containing this location. |
/// |
@@ -85,3 +91,10 @@ class SourceLocation implements Comparable<SourceLocation> { |
String toString() => '<$runtimeType: $offset $toolString>'; |
} |
+ |
+/// A base class for source locations with [offset], [line], and [column] known |
+/// at construction time. |
+class SourceLocationBase extends SourceLocation { |
+ SourceLocationBase(int offset, {sourceUrl, int line, int column}) |
+ : super(offset, sourceUrl: sourceUrl, line: line, column: column); |
+} |