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

Method Validate

expr/node.go:1317–1327  ·  view source on GitHub ↗

* Negation I wanted to do negation on Binaries, but ended up not doing for now ie, rewrite NOT (X == "y") => X != "y" The general problem we ran into is that we lose some fidelity in collapsing AST that is necessary for other evaluation run-times. logically `NOT (X > y)` is NOT THE SAME AS

()

Source from the content-addressed store, hash-verified

1315}
1316*/
1317func (m *BinaryNode) Validate() error {
1318 if len(m.Args) != 2 {
1319 return fmt.Errorf("not enough args in binary expected 2 got %d", len(m.Args))
1320 }
1321 for _, n := range m.Args {
1322 if err := n.Validate(); err != nil {
1323 return err
1324 }
1325 }
1326 return nil
1327}
1328func (m *BinaryNode) ChildrenArgs() []Node {
1329 return m.Args
1330}

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.80
ValidateMethod · 0.65

Tested by

no test coverage detected