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

Unified Diff: pkg/front_end/lib/src/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 | « pkg/front_end/lib/src/dependency_grapher_impl.dart ('k') | pkg/front_end/lib/src/scanner/scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/scanner/reader.dart
diff --git a/pkg/front_end/lib/src/scanner/reader.dart b/pkg/front_end/lib/src/scanner/reader.dart
index b0791396e4f703e914258edce7ecb6e6d8b3bbbe..d0cc35219c3a4e3a874b1dff1c9df41f21207da9 100644
--- a/pkg/front_end/lib/src/scanner/reader.dart
+++ b/pkg/front_end/lib/src/scanner/reader.dart
@@ -28,6 +28,11 @@ abstract class CharacterReader {
int advance();
/**
+ * Return the source to be scanned.
+ */
+ String getContents();
+
+ /**
* Return the substring of the source code between the [start] offset and the
* modified current position. The current position is modified by adding the
* [endDelta], which is the number of characters after the current location to
@@ -88,6 +93,9 @@ class CharSequenceReader implements CharacterReader {
}
@override
+ String getContents() => _sequence;
+
+ @override
String getString(int start, int endDelta) =>
_sequence.substring(start, _charOffset + endDelta);
@@ -128,6 +136,9 @@ class SubSequenceReader extends CharSequenceReader {
}
@override
+ String getContents() => super.getContents().substring(_offsetDelta);
+
+ @override
String getString(int start, int endDelta) =>
super.getString(start - _offsetDelta, endDelta);
}
« no previous file with comments | « pkg/front_end/lib/src/dependency_grapher_impl.dart ('k') | pkg/front_end/lib/src/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698