code: func (p *Parser) parseDeleteStatement() (Statement, error) {
  	stmt := &DeleteSeriesStatement{}
  	var err error
  
  	tok, pos, lit := p.ScanIgnoreWhitespace()
  
  	if tok == FROM {
  		// Parse source.
  		if stmt.Sources, err = p.parseSources(false); err != nil {
  			return nil, err
  		}
  
  		var err error
  		WalkFunc(stmt.Sources, func(n Node) {
  			if t, ok := n.(*Measurement); ok {
  				// Don't allow database or retention policy in from clause for delete
  				// statement.  They apply to the selected database across all retention
  				// policies.
  				if t.Database != "" {
  					err = &ParseError{Message: "database not supported"}
  				}
  				if t.RetentionPolicy != "" {
  					err = &ParseError{Message: "retention policy not supported"}
  				}
  			}
  		})
  		if err != nil {
  			return nil, err
  		}
  
  	} else {
  		p.Unscan()
  	}
  
  	// Parse condition: "WHERE EXPR".
  	if stmt.Condition, err = p.parseCondition(); err != nil {
  		return nil, err
  	}
  
  	// If they didn't provide a FROM or a WHERE, this query is invalid
  	if stmt.Condition == nil && stmt.Sources == nil {
  		return nil, newParseError(tokstr(tok, lit), []string{"FROM", "WHERE"}, pos)
  	}
  
  	return stmt, nil
  }
docs: // parseDeleteStatement parses a string and returns a delete statement.
  // This function assumes the DELETE token has already been consumed.