lang: Refactor most functions to support modules
This is a giant refactor to move functions into a hierarchial module layout. While this isn't entirely implemented yet, it should work correctly once all the import bits have landed. What's broken at the moment is the template function, which currently doesn't understand the period separator.
This commit is contained in:
@@ -42,6 +42,12 @@ func Register(name string, fn *types.FuncValue) {
|
||||
funcs.Register(name, func() interfaces.Func { return &simpleFunc{Fn: fn} })
|
||||
}
|
||||
|
||||
// ModuleRegister is exactly like Register, except that it registers within a
|
||||
// named module. This is a helper function.
|
||||
func ModuleRegister(module, name string, fn *types.FuncValue) {
|
||||
Register(module+funcs.ModuleSep+name, fn)
|
||||
}
|
||||
|
||||
// simpleFunc is a scaffolding function struct which fulfills the boiler-plate
|
||||
// for the function API, but that can run a very simple, static, pure function.
|
||||
type simpleFunc struct {
|
||||
|
||||
Reference in New Issue
Block a user