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

Method parseOrRHS

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

Source from the content-addressed store, hash-verified

171}
172
173func (p *parser) parseOrRHS(lhs *Constraint) (c *Constraint, err error) {
174 var rhs *Constraint
175 c = lhs
176 for {
177 rhs, err = p.parseAnd()
178 if err != nil {
179 return
180 }
181 c = orConst(c, rhs)
182 switch p.peek().typ {
183 case tokenOr:
184 p.next()
185 case tokenAnd, tokenClose, tokenEOF:
186 return
187 }
188 }
189}
190
191func (p *parser) parseAnd() (c *Constraint, err error) {
192 c, err = p.parseOperand()

Callers 2

parseExpMethod · 0.95
TestParseOrRhsFunction · 0.80

Calls 4

parseAndMethod · 0.95
peekMethod · 0.95
nextMethod · 0.95
orConstFunction · 0.85

Tested by 1

TestParseOrRhsFunction · 0.64