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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/string_scanner.dart

Issue 2763833002: fasta.CommentToken implement analyzer.CommentToken (Closed)
Patch Set: merge 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
Index: pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
index a7ac73b27a567fd9e2c3c1358e34e491e06aaecf..af35b011fcf60e5618ef3e6f6ef87ce94da9ca3d 100644
--- a/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
@@ -8,7 +8,7 @@ import 'array_based_scanner.dart' show ArrayBasedScanner;
import 'precedence.dart' show PrecedenceInfo;
-import 'token.dart' show StringToken;
+import 'token.dart' show CommentToken, DartDocToken, StringToken;
/**
* Scanner that reads from a String and creates tokens that points to
@@ -50,5 +50,23 @@ class StringScanner extends ArrayBasedScanner {
canonicalize: true);
}
+ @override
+ CommentToken createCommentToken(
+ PrecedenceInfo info, int start, bool asciiOnly,
+ [int extraOffset = 0]) {
+ return new CommentToken.fromSubstring(
+ info, string, start, scanOffset + extraOffset, tokenStart,
+ canonicalize: true);
+ }
+
+ @override
+ DartDocToken createDartDocToken(
+ PrecedenceInfo info, int start, bool asciiOnly,
+ [int extraOffset = 0]) {
+ return new DartDocToken.fromSubstring(
+ info, string, start, scanOffset + extraOffset, tokenStart,
+ canonicalize: true);
+ }
+
bool atEndOfFile() => scanOffset >= string.length - 1;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart ('k') | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698