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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/token_utils.dart

Issue 2739583002: add previous token field (Closed)
Patch Set: 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/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..c61927aee5e4c973c01dcc01f9df7b36a92053b5 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.previous = 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.previous = 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.previous = tokenTail;
tokenTail.next.precedingComments =
translateComments(analyzerToken.precedingComments);
return tokenHead.next;

Powered by Google App Engine
This is Rietveld 408576698