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

Unified Diff: pkg/analyzer/lib/src/dart/scanner/reader.dart

Issue 2784363002: flag to enable fasta scanner in analyzer (Closed)
Patch Set: rebase Created 3 years, 9 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 | « no previous file | pkg/analyzer/lib/src/dart/scanner/scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698