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

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

Issue 2794653002: fasta tokens implement analyzer token API (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/analyzer/lib/src/fasta/token_utils.dart
diff --git a/pkg/analyzer/lib/src/fasta/token_utils.dart b/pkg/analyzer/lib/src/fasta/token_utils.dart
index 1e26cbe725486b5963efe2c68343990a5b17e270..34de7a6a55d50d015c954e47756509003ab3d73f 100644
--- a/pkg/analyzer/lib/src/fasta/token_utils.dart
+++ b/pkg/analyzer/lib/src/fasta/token_utils.dart
@@ -154,7 +154,7 @@ class ToAnalyzerTokenStreamConverter {
_beginTokenStack.removeLast();
_endTokenStack.removeLast();
}
- // Synthetic end tokens use the same offset as the begin token.
+ // Synthetic end tokens have a length of zero.
if (translatedToken is analyzer.BeginToken &&
token is BeginGroupToken &&
token.endGroup != null &&
@@ -236,7 +236,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
token = token.next;
while (token != null) {
tail.next = fromAnalyzerToken(token);
- tail.next.previousToken = tail;
+ tail.next.previous = tail;
tail = tail.next;
token = token.next;
}
@@ -248,7 +248,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
token.precedingCommentTokens =
translateComments(analyzerToken.precedingComments);
tokenTail.next = token;
- tokenTail.next.previousToken = tokenTail;
+ tokenTail.next.previous = tokenTail;
tokenTail = token;
matchGroups(analyzerToken, token);
return analyzerToken.next;
@@ -258,7 +258,7 @@ Token fromAnalyzerTokenStream(analyzer.Token analyzerToken) {
// TODO(paulberry): join up begingroup/endgroup.
if (analyzerToken.type == TokenType.EOF) {
tokenTail.next = new SymbolToken.eof(analyzerToken.offset);
- tokenTail.next.previousToken = tokenTail;
+ tokenTail.next.previous = tokenTail;
tokenTail.next.precedingCommentTokens =
translateComments(analyzerToken.precedingComments);
tokenTail.next.next = tokenTail.next;

Powered by Google App Engine
This is Rietveld 408576698