EvalTransform evaluates a transform.
( head ast.Atom, transform ast.Transform, input []ast.ConstSubstList, emit func(atom ast.Atom) bool)
| 27 | |
| 28 | // EvalTransform evaluates a transform. |
| 29 | func EvalTransform( |
| 30 | head ast.Atom, |
| 31 | transform ast.Transform, |
| 32 | input []ast.ConstSubstList, |
| 33 | emit func(atom ast.Atom) bool) error { |
| 34 | |
| 35 | if transform.IsLetTransform() { |
| 36 | return evalLet(head, transform, input, emit) |
| 37 | } |
| 38 | return evalDo(head, transform, input, emit) |
| 39 | } |
| 40 | |
| 41 | // evalLet evaluates a let transform. This consists of a number of let statements, |
| 42 | // each acting on a single row. |