code: func (p *Parser) ParseDuration() (time.Duration, error) {
  	tok, pos, lit := p.ScanIgnoreWhitespace()
  	if tok != DURATIONVAL && tok != INF {
  		return 0, newParseError(tokstr(tok, lit), []string{"duration"}, pos)
  	}
  
  	if tok == INF {
  		return 0, nil
  	}
  
  	d, err := ParseDuration(lit)
  	if err != nil {
  		return 0, &ParseError{Message: err.Error(), Pos: pos}
  	}
  
  	return d, nil
  }
docs: // ParseDuration parses a string and returns a duration literal.
  // This function assumes the DURATION token has already been consumed.