code: public final Parser<Token> token() {
      return new Parser<Token>() {
        @Override boolean apply(ParseContext ctxt) {
          int begin = ctxt.getIndex();
          if (!Parser.this.apply(ctxt)) {
            return false;
          }
          int len = ctxt.getIndex() - begin;
          Token token = new Token(begin, len, ctxt.result);
          ctxt.result = token;
          return true;
        }
        @Override public String toString() {
          return Parser.this.toString();
        }
      };
    }
docs: A {@link Parser} that runs {@code this} and wraps the return value in a {@link Token}.
  
  <p>It is normally not necessary to call this method explicitly. {@link #lexer(Parser)} and {@link #from(Parser,
  Parser)} both do the conversion automatically.