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

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

Issue 2933533002: Add option for printing tokens produced by the scanner. (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/scanner_main.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/scanner_main.dart b/pkg/front_end/lib/src/fasta/scanner/scanner_main.dart
index f56aa98d06d63ba47a2719aedaa9f8090694596b..dfa2723be3c70d02695e357b652b54364af30f4c 100644
--- a/pkg/front_end/lib/src/fasta/scanner/scanner_main.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/scanner_main.dart
@@ -12,7 +12,13 @@ scanAll(Map<Uri, List<int>> files) {
Stopwatch sw = new Stopwatch()..start();
int byteCount = 0;
files.forEach((Uri uri, List<int> bytes) {
- scan(bytes);
+ var token = scan(bytes).tokens;
+ if (const bool.fromEnvironment("printTokens")) {
+ while (!token.isEof) {
+ print("${token.charOffset}: ${token}");
+ token = token.next;
+ }
+ }
byteCount += bytes.length - 1;
});
sw.stop();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698