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

Unified Diff: pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart

Issue 2955453002: improve fasta parser export declaration recovery (Closed)
Patch Set: Created 3 years, 6 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/messages.yaml » ('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 d9dc176f4e03e4e619161dd8cb72b49cd25bcc2e..abe275b11b4d3fa8032ad73a6875e1e28ecc5d48 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
@@ -33,11 +33,11 @@ class TokenStreamRewriter {
Token get firstToken => _head.next;
/// Inserts [newToken] into the token stream just before [insertionPoint], and
- /// fixes up all "next" and "previous" pointers.
+ /// fixes up all "next" and "previous" pointers. Returns [newToken].
///
/// Caller is required to ensure that [insertionPoint] is actually present in
/// the token stream.
- void insertTokenBefore(Token newToken, Token insertionPoint) {
+ Token insertTokenBefore(Token newToken, Token insertionPoint) {
Token previous = _findPreviousToken(insertionPoint);
_lastPreviousToken = previous;
newToken.next = insertionPoint;
@@ -49,6 +49,7 @@ class TokenStreamRewriter {
insertionPoint.previous = newToken;
newToken.previous = previous;
}
+ return newToken;
}
/// Finds the token that immediately precedes [target].
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698