Register a transform once, and derive the calls a typed column's error offers from builtin.number

This commit is contained in:
2026-09-25 08:43:58 +02:00
committed by Lillem4n
parent a048cdd73c
commit d81cfd5757
5 changed files with 40 additions and 21 deletions
+7
View File
@@ -14,6 +14,13 @@ var transforms = map[string]func(string) string{
"uppercase": strings.ToUpper,
}
func withTransforms(builtins map[string]builtin) map[string]builtin {
for name, fn := range transforms {
builtins[name] = builtin{arity: 1, check: transformArg, prep: transformPrep(fn), operands: transformOperand}
}
return builtins
}
// unwrapTransform peels nested transform calls off an operand arg, returning the
// field it finally names and the transforms to apply, innermost last.
func unwrapTransform(arg string) (leaf string, chain []func(string) string, err error) {