| Index: pkg/front_end/lib/src/fasta/scanner/token.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
|
| index 83a98013e5b66f58f4d088e9393235800f18e022..4be106753f8b614957d70cda0d0db311352c22ad 100644
|
| --- a/pkg/front_end/lib/src/fasta/scanner/token.dart
|
| +++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
|
| @@ -463,6 +463,9 @@ class StringToken extends Token implements analyzer.StringToken {
|
| }
|
|
|
| class CommentToken extends StringToken implements analyzer.CommentToken {
|
| + @override
|
| + analyzer.TokenWithComment parent;
|
| +
|
| /**
|
| * Creates a lazy comment token. If [canonicalize] is true, the string
|
| * is canonicalized before the token is created.
|
| @@ -495,23 +498,14 @@ class CommentToken extends StringToken implements analyzer.CommentToken {
|
| new CommentToken._(info, valueOrLazySubstring, charOffset);
|
|
|
| @override
|
| - analyzer.TokenWithComment get parent {
|
| - Token token = next;
|
| - while (token is CommentToken) {
|
| - token = token.next;
|
| - }
|
| - return token;
|
| - }
|
| -
|
| - @override
|
| - void set parent(analyzer.TokenWithComment ignored) {
|
| - throw 'unsupported operation';
|
| - }
|
| -
|
| - @override
|
| void remove() {
|
| - // TODO: implement remove
|
| - throw 'not implemented yet';
|
| + if (previous != null) {
|
| + previous.setNextWithoutSettingPrevious(next);
|
| + next?.previous = previous;
|
| + } else {
|
| + assert(parent.precedingComments == this);
|
| + parent.precedingComments = next as CommentToken;
|
| + }
|
| }
|
| }
|
|
|
|
|