code: func (p *Parser) ParseInt(min, max int) (int, error) {
  	tok, pos, lit := p.ScanIgnoreWhitespace()
  	if tok != INTEGER {
  		return 0, newParseError(tokstr(tok, lit), []string{"integer"}, pos)
  	}
  
  	// Convert string to int.
  	n, err := strconv.Atoi(lit)
  	if err != nil {
  		return 0, &ParseError{Message: err.Error(), Pos: pos}
  	} else if min > n || n > max {
  		return 0, &ParseError{
  			Message: fmt.Sprintf("invalid value %d: must be %d <= n <= %d", n, min, max),
  			Pos:     pos,
  		}
  	}
  
  	return n, nil
  }
docs: // ParseInt parses a string representing a base 10 integer and returns the number.
  // It returns an error if the parsed number is outside the range [min, max].