code: func (p *Parser) parseDimensions() (Dimensions, error) {
  	// If the next token is not GROUP then exit.
  	if tok, _, _ := p.ScanIgnoreWhitespace(); tok != GROUP {
  		p.Unscan()
  		return nil, nil
  	}
  
  	// Now the next token should be "BY".
  	if tok, pos, lit := p.ScanIgnoreWhitespace(); tok != BY {
  		return nil, newParseError(tokstr(tok, lit), []string{"BY"}, pos)
  	}
  
  	var dimensions Dimensions
  	for {
  		// Parse the dimension.
  		d, err := p.parseDimension()
  		if err != nil {
  			return nil, err
  		}
  
  		// Add new dimension.
  		dimensions = append(dimensions, d)
  
  		// If there's not a comma next then stop parsing dimensions.
  		if tok, _, _ := p.Scan(); tok != COMMA {
  			p.Unscan()
  			break
  		}
  	}
  	return dimensions, nil
  }
docs: // parseDimensions parses the "GROUP BY" clause of the query, if it exists.