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

Method FromExpr

expr/node.go:1630–1647  ·  view source on GitHub ↗
(e *Expr)

Source from the content-addressed store, hash-verified

1628 return fe
1629}
1630func (m *TriNode) FromExpr(e *Expr) error {
1631 if e.Op == "" {
1632 return fmt.Errorf("unrecognized TriNode no op")
1633 }
1634 m.Operator = lex.TokenFromOp(e.Op)
1635 if len(e.Args) == 0 {
1636 return fmt.Errorf("Invalid TriNode, expected args %+v", e)
1637 }
1638 if m.Operator.T == lex.TokenNil {
1639 return fmt.Errorf("Unrecognized op %v", e.Op)
1640 }
1641 args, err := NodesFromExprs(e.Args)
1642 if err != nil {
1643 return err
1644 }
1645 m.Args = args
1646 return nil
1647}
1648func (m *TriNode) Equal(n Node) bool {
1649 if m == nil && n == nil {
1650 return true

Callers

nothing calls this directly

Calls 3

TokenFromOpFunction · 0.92
NodesFromExprsFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected