code: func (p *parser) Parse() (*Query, error) {
  	buf, err := ioutil.ReadAll(p.r)
  	if err != nil {
  		return nil, errors.Wrap(err, "reading buffer to parse")
  	}
  	p.PQL = PQL{
  		Buffer: string(buf),
  	}
  	p.Init()
  	err = p.PQL.Parse()
  	if err != nil {
  		return nil, errors.Wrap(err, "parsing")
  	}
  
  	// Handle specific panics from the parser and return them as errors.
  	var v interface{}
  	func() {
  		defer func() { v = recover() }()
  		p.Execute()
  	}()
  	if v != nil {
  		if strings.HasPrefix(v.(string), duplicateArgErrorMessage) {
  			return nil, fmt.Errorf("%s", v)
  		} else {
  			panic(v)
  		}
  	}
  
  	return &p.Query, nil
  }
docs: // Parse parses the next node in the query.