code: private HtmlToken collapseSubsequent(HtmlToken token) {
      HtmlToken collapsed = token;
      for (HtmlToken next;
           (next= peekToken(0)) != null && next.type == token.type;
           readToken()) {
        collapsed = join(collapsed, next);
      }
      return collapsed;
    }
docs: Collapses all the following tokens of the same type into this.token.