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]. |