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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/token_utils.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 | « no previous file | pkg/front_end/lib/src/fasta/scanner/array_based_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/fasta/analyzer/token_utils.dart
diff --git a/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart b/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
index 11915cf7abc27775b0b472111e0b8a2324a06d1e..b1244f24b4f6842e1677a88fa407c1b9e8cbb122 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
@@ -282,6 +282,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
token = token.next;
while (token != null) {
tail.next = fromAnalyzerToken(token);
+ tail.next.previousToken = tail;
tail = tail.next;
token = token.next;
}
@@ -293,6 +294,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
token.precedingComments =
translateComments(analyzerToken.precedingComments);
tokenTail.next = token;
+ tokenTail.next.previousToken = tokenTail;
tokenTail = token;
matchGroups(analyzerToken, token);
return analyzerToken.next;
@@ -302,6 +304,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
// TODO(paulberry): join up begingroup/endgroup.
if (analyzerToken.type == TokenType.EOF) {
tokenTail.next = new SymbolToken(EOF_INFO, analyzerToken.offset);
+ tokenTail.next.previousToken = tokenTail;
tokenTail.next.precedingComments =
translateComments(analyzerToken.precedingComments);
return tokenHead.next;
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698