diff --git a/go/src/miller/dsl/cst/functions.go b/go/src/miller/dsl/cst/functions.go index 6fa3bda82..a82f0f32e 100644 --- a/go/src/miller/dsl/cst/functions.go +++ b/go/src/miller/dsl/cst/functions.go @@ -5,7 +5,39 @@ import ( "miller/lib" ) -// xxx temp +// ================================================================ +type NodeBuilder func (astNode *dsl.ASTNode) (IEvaluable, error) + +type FunctionInfo struct { + name string + nodeBuilder NodeBuilder + // help string + // builder ... + // func Builder(astNode *dsl.ASTNode) (IEvaluable, error) { ... } + // type UnaryFunc func(*Mlrval) Mlrval +} + +type FunctionManager struct { +} + +func (this *FunctionManager) LookUp(functionName string) *FunctionInfo { + return nil +} + +// ================================================================ +func BuildFunctionCallsiteNode(astNode *dsl.ASTNode) (IEvaluable, error) { + lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypeFunctionCallsite) + + return BuildPanicNode(), nil + + //return nil, errors.New( + //"CST BuildFunctionCallsiteNode: unhandled AST node type " + string(astNode.Type), + //) +} + +// ================================================================ +// ================================================================ +// ================================================================ // . + + - - * / // .+ .+ .- .- .* ./ .// // % ** | ^ & ~ << >> bitcount == != =~ !=~ > >= < <= && || ^^ ! ? : @@ -30,17 +62,6 @@ import ( // substr system systime tan tanh tolower toupper typeof urand urand32 // urandint urandrange -// ---------------------------------------------------------------- -func BuildFunctionCallsiteNode(astNode *dsl.ASTNode) (IEvaluable, error) { - lib.InternalCodingErrorIf(astNode.Type != dsl.NodeTypeFunctionCallsite) - - return BuildPanicNode(), nil - - //return nil, errors.New( - //"CST BuildFunctionCallsiteNode: unhandled AST node type " + string(astNode.Type), - //) -} - //// ---------------------------------------------------------------- //type UnaryFunctionCallsiteNode struct { // evaluable1 IEvaluable diff --git a/go/todo.txt b/go/todo.txt index da0d04052..3cfb8c775 100644 --- a/go/todo.txt +++ b/go/todo.txt @@ -3,6 +3,8 @@ TOP OF LIST: * friday: o functions?!? + - lib/mlrval_operators.go -> lib/mlrval_functions.go + - cst/operators.go -> cst/functions.go * begin/end hygiene: - AST tree-walk / CST build: must be at top level - tree-walk begin/end to check for invalids ($-anything etc)