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

Unified Diff: pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.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/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/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/parser/token_stream_rewriter.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
index 21cd030bfb63c0dba16f551bf533f3e45390e7a1..d9dc176f4e03e4e619161dd8cb72b49cd25bcc2e 100644
--- a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
+++ b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
@@ -3,8 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:front_end/src/fasta/errors.dart';
-import 'package:front_end/src/fasta/scanner/token.dart';
-import 'package:front_end/src/scanner/token.dart' show Token;
+import 'package:front_end/src/scanner/token.dart' show BeginToken, Token;
/// Provides the capability of inserting tokens into a token stream by rewriting
/// the previous token to point to the inserted token.
@@ -27,8 +26,7 @@ class TokenStreamRewriter {
/// Creates a [TokenStreamRewriter] which is prepared to rewrite the token
/// stream whose first token is [firstToken].
TokenStreamRewriter(Token firstToken)
- : _head =
- firstToken.previous ?? (new SymbolToken.eof(-1)..next = firstToken);
+ : _head = firstToken.previous ?? (new Token.eof(-1)..next = firstToken);
/// Gets the first token in the stream (which may not be the same token that
/// was passed to the constructor, if something was inserted before it).
@@ -89,7 +87,7 @@ class TokenStreamRewriter {
Token _scanForPreviousToken(Token target, Token pos) {
while (!identical(pos.next, target)) {
Token nextPos;
- if (pos is BeginGroupToken &&
+ if (pos is BeginToken &&
pos.endGroup != null &&
pos.endGroup.charOffset < target.charOffset) {
nextPos = pos.endGroup;
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698