copyComments method

  1. @override
Token copyComments(
  1. Token token
)
inherited

Copy a linked list of comment tokens identical to the given comment tokens.

Implementation

@override
Token copyComments(Token token) {
  if (token == null) {
    return null;
  }
  Token head = token.copy();
  Token tail = head;
  token = token.next;
  while (token != null) {
    tail = tail.setNext(token.copy());
    token = token.next;
  }
  return head;
}