Expr convert the FuncNode to Expr
()
| 598 | |
| 599 | // Expr convert the FuncNode to Expr |
| 600 | func (m *FuncNode) Expr() *Expr { |
| 601 | fe := &Expr{Op: lex.TokenUdfExpr.String()} |
| 602 | if len(m.Args) > 0 { |
| 603 | fe.Args = []*Expr{{Identity: m.Name}} |
| 604 | fe.Args = append(fe.Args, ExprsFromNodes(m.Args)...) |
| 605 | } |
| 606 | return fe |
| 607 | } |
| 608 | func (m *FuncNode) FromExpr(e *Expr) error { |
| 609 | if e.Op != lex.TokenUdfExpr.String() { |
| 610 | return fmt.Errorf("Expected 'expr' but got %v", e.Op) |
nothing calls this directly
no test coverage detected