Index: pkg/analyzer/lib/src/dart/scanner/reader.dart |
diff --git a/pkg/analyzer/lib/src/dart/scanner/reader.dart b/pkg/analyzer/lib/src/dart/scanner/reader.dart |
index 6e111e266756abeaac09e260bedb14e98595fe6b..2b49cd77ef3b162182bf9cf8381b23994413d446 100644 |
--- a/pkg/analyzer/lib/src/dart/scanner/reader.dart |
+++ b/pkg/analyzer/lib/src/dart/scanner/reader.dart |
@@ -20,6 +20,11 @@ class CharacterRangeReader extends CharacterReader { |
final CharacterReader baseReader; |
/** |
+ * The first character to be read. |
+ */ |
+ final int startIndex; |
+ |
+ /** |
* The last character to be read. |
*/ |
final int endIndex; |
@@ -28,7 +33,7 @@ class CharacterRangeReader extends CharacterReader { |
* Initialize a newly created reader to read the characters from the given |
* [baseReader] between the [startIndex] inclusive to [endIndex] exclusive. |
*/ |
- CharacterRangeReader(this.baseReader, int startIndex, this.endIndex) { |
+ CharacterRangeReader(this.baseReader, this.startIndex, this.endIndex) { |
baseReader.offset = startIndex - 1; |
} |
@@ -49,6 +54,10 @@ class CharacterRangeReader extends CharacterReader { |
} |
@override |
+ String getContents() => |
+ baseReader.getContents().substring(startIndex, endIndex); |
+ |
+ @override |
String getString(int start, int endDelta) => |
baseReader.getString(start, endDelta); |