Index: lib/src/span.dart |
diff --git a/lib/src/span.dart b/lib/src/span.dart |
index fe1ac3956bcbcc4f0dd1e0ca492959424de60e85..6ee68b494de361d2e421c1a483f62a46523ef4ba 100644 |
--- a/lib/src/span.dart |
+++ b/lib/src/span.dart |
@@ -58,11 +58,18 @@ abstract class SourceSpan implements Comparable<SourceSpan> { |
/// A base class for source spans with [start], [end], and [text] known at |
/// construction time. |
class SourceSpanBase extends SourceSpanMixin { |
- final SourceLocation start; |
- final SourceLocation end; |
- final String text; |
+ // These fields go through getters so that subclasses can override them. |
+ |
+ SourceLocation get start => _start; |
+ final SourceLocation _start; |
+ |
+ SourceLocation get end => _end; |
+ final SourceLocation _end; |
+ |
+ String get text => _text; |
+ final String _text; |
- SourceSpanBase(this.start, this.end, this.text) { |
+ SourceSpanBase(this._start, this._end, this._text) { |
if (end.sourceUrl != start.sourceUrl) { |
throw new ArgumentError("Source URLs \"${start.sourceUrl}\" and " |
" \"${end.sourceUrl}\" don't match."); |