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

Method A

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

Source from the content-addressed store, hash-verified

342}
343
344func (t *tree) A(depth int) Node {
345 debugf(depth, "A pre: %v", t.Cur())
346 n := t.C(depth)
347 for {
348 debugf(depth, "A post: cur=%v peek=%v", t.Cur(), t.Peek())
349 switch tok := t.Cur(); tok.T {
350 case lex.TokenLogicAnd, lex.TokenAnd:
351 p := t.Peek()
352 if p.T == lex.TokenLeftParenthesis && t.boolean {
353 // This is a Boolean Expression Not Binary
354 return n
355 }
356 t.Next()
357 debugf(depth, "AND pre-binary n=%s", n)
358 n = NewBinaryNode(tok, n, t.C(depth+1))
359 debugf(depth, "and post %s", n)
360 default:
361 return n
362 }
363 }
364}
365
366func (t *tree) C(depth int) Node {
367 debugf(depth, "C pre: %v", t.Cur())

Callers 1

OMethod · 0.95

Calls 6

CMethod · 0.95
NewBinaryNodeFunction · 0.85
debugfFunction · 0.70
CurMethod · 0.65
PeekMethod · 0.65
NextMethod · 0.65

Tested by

no test coverage detected