code: func (p *Parser) ParseOptionalTokenAndInt(t Token) (int, error) {
  	// Check if the token exists.
  	if tok, _, _ := p.ScanIgnoreWhitespace(); tok != t {
  		p.Unscan()
  		return 0, nil
  	}
  
  	// Scan the number.
  	tok, pos, lit := p.ScanIgnoreWhitespace()
  	if tok != INTEGER {
  		return 0, newParseError(tokstr(tok, lit), []string{"integer"}, pos)
  	}
  
  	// Parse number.
  	n, _ := strconv.ParseInt(lit, 10, 64)
  	if n < 0 {
  		msg := fmt.Sprintf("%s must be >= 0", t.String())
  		return 0, &ParseError{Message: msg, Pos: pos}
  	}
  
  	return int(n), nil
  }
docs: // ParseOptionalTokenAndInt parses the specified token followed
  // by an int, if it exists.