MCPcopy Index your code
hub / github.com/perkeep/perkeep / parseAndRHS

Method parseAndRHS

pkg/search/expr.go:205–223  ·  view source on GitHub ↗
(lhs *Constraint)

Source from the content-addressed store, hash-verified

203}
204
205func (p *parser) parseAndRHS(lhs *Constraint) (c *Constraint, err error) {
206 var rhs *Constraint
207 c = lhs
208 for {
209 rhs, err = p.parseOperand()
210 if err != nil {
211 return
212 }
213 c = andConst(c, rhs)
214 switch p.peek().typ {
215 case tokenOr, tokenClose, tokenEOF:
216 return
217 case tokenAnd:
218 p.next()
219 continue
220 }
221 return
222 }
223}
224
225func (p *parser) parseOperand() (c *Constraint, err error) {
226 negated := p.stripNot()

Callers 3

parseExpMethod · 0.95
parseAndMethod · 0.95
TestParseConjuctionFunction · 0.80

Calls 4

parseOperandMethod · 0.95
peekMethod · 0.95
nextMethod · 0.95
andConstFunction · 0.85

Tested by 1

TestParseConjuctionFunction · 0.64