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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2899043006: cleanup fasta token classes (Closed)
Patch Set: Created 3 years, 7 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/analyzer/lib/src/fasta/token_utils.dart ('k') | pkg/analyzer/lib/src/summary/fasta/stack_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index e6e52439105b0167c9802c9fad03abb9398740b5..3c2f00c3e823945c3f11ddd3c9fed0d3d2618bf6 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -1838,7 +1838,7 @@ class Parser {
nameToken = new SyntheticStringToken(
TokenType.IDENTIFIER, '', nameOffset);
}
- nameToken.setNext(new SimpleToken(TokenType.EOF, nameToken.end));
+ nameToken.setNext(new Token.eof(nameToken.end));
references.add(astFactory.commentReference(
null, astFactory.simpleIdentifier(nameToken)));
token.references.add(nameToken);
@@ -1971,9 +1971,7 @@ class Parser {
member = parseCompilationUnitMember(commentAndMetadata);
} on _TooDeepTreeError {
_reportErrorForToken(ParserErrorCode.STACK_OVERFLOW, _currentToken);
- Token eof = new Token(TokenType.EOF, 0);
- eof.previous = eof;
- eof.setNext(eof);
+ Token eof = new Token.eof(0);
return astFactory.compilationUnit(eof, null, null, null, eof);
}
if (member != null) {
@@ -5818,8 +5816,7 @@ class Parser {
return null;
}
token = token is CommentToken ? token.parent : token;
- Token head = new Token(TokenType.EOF, -1);
- head.setNext(head);
+ Token head = new Token.eof(-1);
Token current = head;
while (token.type != TokenType.EOF) {
Token clone = token.copy();
@@ -5827,8 +5824,7 @@ class Parser {
current = clone;
token = token.next;
}
- Token tail = new Token(TokenType.EOF, 0);
- tail.setNext(tail);
+ Token tail = new Token.eof(0);
current.setNext(tail);
return head.next;
}
« no previous file with comments | « pkg/analyzer/lib/src/fasta/token_utils.dart ('k') | pkg/analyzer/lib/src/summary/fasta/stack_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698