code: func (p *Parser) ParseQuery() (*Query, error) {
  	var statements Statements
  	semi := true
  
  	for {
  		if tok, pos, lit := p.ScanIgnoreWhitespace(); tok == EOF {
  			return &Query{Statements: statements}, nil
  		} else if tok == SEMICOLON {
  			semi = true
  		} else {
  			if !semi {
  				return nil, newParseError(tokstr(tok, lit), []string{";"}, pos)
  			}
  			p.Unscan()
  			s, err := p.ParseStatement()
  			if err != nil {
  				return nil, err
  			}
  			statements = append(statements, s)
  			semi = false
  		}
  	}
  }
docs: // ParseQuery parses an InfluxQL string and returns a Query AST object.