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

Unified Diff: pkg/front_end/test/scanner_fasta_test.dart

Issue 2739583002: add previous token field (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
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/token.dart ('k') | pkg/front_end/tool/fasta/compile.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/scanner_fasta_test.dart
diff --git a/pkg/front_end/test/scanner_fasta_test.dart b/pkg/front_end/test/scanner_fasta_test.dart
index 0003ba12c6ef0ed6fce9392aba77a31c21d8ae08..14deb22c1ad05a1f7c3b4a3e0b9d46a8ceab4cdc 100644
--- a/pkg/front_end/test/scanner_fasta_test.dart
+++ b/pkg/front_end/test/scanner_fasta_test.dart
@@ -194,6 +194,23 @@ class ScannerTest_Fasta extends ScannerTestBase {
super.test_scriptTag_withArgs();
}
+ void test_next_previous() {
+ const source = 'int a; /*1*/ /*2*/ /*3*/ B f(){if (a < 2) {}}';
+ fasta.Token token =
+ new fasta.StringScanner(source, includeComments: true).tokenize();
+ while (!token.isEof) {
+ expect(token.next.previousToken, token);
+ fasta.Token commentToken = token.precedingComments;
+ while (commentToken != null) {
+ if (commentToken.next != null) {
+ expect(commentToken.next.previousToken, commentToken);
+ }
+ commentToken = commentToken.next;
+ }
+ token = token.next;
+ }
+ }
+
@override
@failingTest
void test_scriptTag_withoutSpace() {
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/token.dart ('k') | pkg/front_end/tool/fasta/compile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698