mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 10:15:36 +00:00
function iterate
This commit is contained in:
parent
ce6c894673
commit
defa2cf323
2 changed files with 35 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue