@@ -54,9 +54,6 @@ class BeginToken extends SimpleToken {
5454 type == TokenType .STRING_INTERPOLATION_EXPRESSION );
5555 }
5656
57- @override
58- Token copy () => new BeginToken (type, offset, copyComments (precedingComments));
59-
6057 @override
6158 Token ? get endGroup => endToken;
6259
@@ -83,25 +80,6 @@ class CommentToken extends StringToken {
8380 */
8481 CommentToken (TokenType type, String value, int offset)
8582 : super (type, value, offset);
86-
87- @override
88- CommentToken copy () => new CommentToken (type, _value, offset);
89-
90- /**
91- * Remove this comment token from the list.
92- *
93- * This is used when we decide to interpret the comment as syntax.
94- */
95- void remove () {
96- Token ? previous = this .previous;
97- if (previous != null ) {
98- previous.setNextWithoutSettingPrevious (next);
99- next? .previous = previous;
100- } else {
101- assert (parent! .precedingComments == this );
102- parent! .precedingComments = next as CommentToken ? ;
103- }
104- }
10583}
10684
10785/**
@@ -114,9 +92,6 @@ class DocumentationCommentToken extends CommentToken {
11492 */
11593 DocumentationCommentToken (TokenType type, String value, int offset)
11694 : super (type, value, offset);
117-
118- @override
119- CommentToken copy () => new DocumentationCommentToken (type, _value, offset);
12095}
12196
12297enum KeywordStyle {
@@ -481,10 +456,6 @@ class KeywordToken extends SimpleToken {
481456 KeywordToken (this .keyword, int offset, [CommentToken ? precedingComment])
482457 : super (keyword, offset, precedingComment);
483458
484- @override
485- Token copy () =>
486- new KeywordToken (keyword, offset, copyComments (precedingComments));
487-
488459 @override
489460 bool get isIdentifier => keyword.isPseudo || keyword.isBuiltIn;
490461
@@ -515,10 +486,6 @@ class LanguageVersionToken extends CommentToken {
515486
516487 LanguageVersionToken .from (String text, int offset, this .major, this .minor)
517488 : super (TokenType .SINGLE_LINE_COMMENT , text, offset);
518-
519- @override
520- LanguageVersionToken copy () =>
521- new LanguageVersionToken .from (lexeme, offset, major, minor);
522489}
523490
524491/**
@@ -633,25 +600,6 @@ class SimpleToken implements Token {
633600 @override
634601 String ? get stringValue => type.stringValue;
635602
636- @override
637- Token copy () =>
638- new SimpleToken (type, offset, copyComments (precedingComments));
639-
640- @override
641- CommentToken ? copyComments (CommentToken ? token) {
642- if (token == null ) {
643- return null ;
644- }
645- CommentToken head = token.copy ();
646- Token tail = head;
647- token = token.next as CommentToken ? ;
648- while (token != null ) {
649- tail = tail.setNext (token.copy ());
650- token = token.next as CommentToken ? ;
651- }
652- return head;
653- }
654-
655603 @override
656604 bool matchesAny (List <TokenType > types) {
657605 for (TokenType type in types) {
@@ -718,10 +666,6 @@ class StringToken extends SimpleToken {
718666 @override
719667 String get lexeme => _value;
720668
721- @override
722- Token copy () =>
723- new StringToken (type, _value, offset, copyComments (precedingComments));
724-
725669 @override
726670 String value () => _value;
727671}
@@ -741,10 +685,6 @@ class SyntheticBeginToken extends BeginToken {
741685 @override
742686 Token ? beforeSynthetic;
743687
744- @override
745- Token copy () =>
746- new SyntheticBeginToken (type, offset, copyComments (precedingComments));
747-
748688 @override
749689 bool get isSynthetic => true ;
750690
@@ -767,9 +707,6 @@ class SyntheticKeywordToken extends KeywordToken {
767707
768708 @override
769709 int get length => 0 ;
770-
771- @override
772- Token copy () => new SyntheticKeywordToken (keyword, offset);
773710}
774711
775712/**
@@ -794,9 +731,6 @@ class SyntheticStringToken extends StringToken {
794731
795732 @override
796733 int get length => _length ?? super .length;
797-
798- @override
799- Token copy () => new SyntheticStringToken (type, _value, offset, _length);
800734}
801735
802736/**
@@ -813,9 +747,6 @@ class SyntheticToken extends SimpleToken {
813747
814748 @override
815749 int get length => 0 ;
816-
817- @override
818- Token copy () => new SyntheticToken (type, offset);
819750}
820751
821752/// A token used to replace another token in the stream, while still keeping the
@@ -839,9 +770,6 @@ class ReplacementToken extends SyntheticToken {
839770
840771 @override
841772 int get length => 0 ;
842-
843- @override
844- Token copy () => new ReplacementToken (type, replacedToken);
845773}
846774
847775/**
@@ -1041,18 +969,6 @@ abstract class Token implements SyntacticEntity {
1041969 */
1042970 TokenType get type;
1043971
1044- /**
1045- * Return a newly created token that is a copy of this tokens
1046- * including any [preceedingComment] tokens,
1047- * but that is not a part of any token stream.
1048- */
1049- Token copy ();
1050-
1051- /**
1052- * Copy a linked list of comment tokens identical to the given comment tokens.
1053- */
1054- CommentToken ? copyComments (CommentToken ? token);
1055-
1056972 /**
1057973 * Return `true` if this token has any one of the given [types] .
1058974 */
0 commit comments