mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-16 11:37:36 +02:00
29 lines
634 B
Go
29 lines
634 B
Go
|
package stdlib
|
||
|
|
||
|
import (
|
||
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||
|
"github.com/MontFerret/ferret/pkg/stdlib/collections"
|
||
|
"github.com/MontFerret/ferret/pkg/stdlib/html"
|
||
|
"github.com/MontFerret/ferret/pkg/stdlib/strings"
|
||
|
"github.com/MontFerret/ferret/pkg/stdlib/types"
|
||
|
"github.com/MontFerret/ferret/pkg/stdlib/utils"
|
||
|
)
|
||
|
|
||
|
func NewLib() map[string]core.Function {
|
||
|
lib := make(map[string]core.Function)
|
||
|
|
||
|
add := func(l map[string]core.Function) {
|
||
|
for name, fn := range l {
|
||
|
lib[name] = fn
|
||
|
}
|
||
|
}
|
||
|
|
||
|
add(types.NewLib())
|
||
|
add(strings.NewLib())
|
||
|
add(collections.NewLib())
|
||
|
add(html.NewLib())
|
||
|
add(utils.NewLib())
|
||
|
|
||
|
return lib
|
||
|
}
|