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

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

Issue 1686173002: fix #25739, incorrectly expanding a generic comment multiple times (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 7a39b047f1529df3d789f1a7f3a7410b8becf33b..c5933ee7245ca82118246af6a42aea7ad12cb621 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -3948,6 +3948,15 @@ class Parser {
String comment = t.lexeme.substring(prefixLen, t.lexeme.length - 2);
Token list = _scanGenericMethodComment(comment, t.offset + prefixLen);
if (list != null) {
+ // Remove the tokens from the comment stream.
+ if (t.previous != null) {
+ t.previous.setNext(t.next);
+ } else {
+ assert(_currentToken.precedingComments == t);
+ // The implementation types all have this setter, but the Token
+ // interface does not.
+ (_currentToken as dynamic).precedingComments = t.next;
Jennifer Messerly 2016/02/10 19:15:07 not enthused about this... suggestions? :)
Bob Nystrom 2016/02/12 17:40:47 Yeah, this seems gross to me, but I don't know the
Brian Wilkerson 2016/02/12 17:56:55 I just turned Token into an interface, and replace
+ }
// Insert the tokens into the stream.
_injectTokenList(list);
return true;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | pkg/analyzer/test/generated/parser_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698