MCPcopy Create free account
hub / github.com/araddon/qlbridge / C

Method C

expr/parse.go:366–389  ·  view source on GitHub ↗
(depth int)

Source from the content-addressed store, hash-verified

364}
365
366func (t *tree) C(depth int) Node {
367 debugf(depth, "C pre: %v", t.Cur())
368 n := t.P(depth)
369 for {
370 debugf(depth, "C post: %v peek=%v n=%v", t.Cur(), t.Peek(), n)
371 switch cur := t.Cur(); cur.T {
372 case lex.TokenNegate:
373 debugf(depth+1, "C NEGATE Urnary?: %v", t.Cur())
374 t.Next()
375 return NewUnary(cur, t.cInner(n, depth+1))
376 case lex.TokenIs:
377 t.Next()
378 if t.Cur().T == lex.TokenNegate {
379 cur = t.Next()
380 ne := lex.Token{T: lex.TokenNE, V: "!="}
381 return NewBinaryNode(ne, n, t.P(depth+1))
382 }
383 u.Warnf("TokenIS? is this supported?")
384 return NewUnary(cur, t.cInner(n, depth+1))
385 default:
386 return t.cInner(n, depth)
387 }
388 }
389}
390
391func (t *tree) cInner(n Node, depth int) Node {
392 for {

Callers 2

AMethod · 0.95
FMethod · 0.95

Calls 8

PMethod · 0.95
cInnerMethod · 0.95
NewUnaryFunction · 0.85
NewBinaryNodeFunction · 0.85
debugfFunction · 0.70
CurMethod · 0.65
PeekMethod · 0.65
NextMethod · 0.65

Tested by

no test coverage detected