operator-builtin.go: builtin "" output the list of builtin module names
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"git.portale-stac.it/go-pkg/expr/kern"
|
"git.portale-stac.it/go-pkg/expr/kern"
|
||||||
"git.portale-stac.it/go-pkg/expr/scan"
|
"git.portale-stac.it/go-pkg/expr/scan"
|
||||||
"git.portale-stac.it/go-pkg/expr/sym"
|
"git.portale-stac.it/go-pkg/expr/sym"
|
||||||
|
"git.portale-stac.it/go-pkg/expr/types/list"
|
||||||
"git.portale-stac.it/go-pkg/expr/types/str"
|
"git.portale-stac.it/go-pkg/expr/types/str"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,7 +36,17 @@ func evalBuiltin(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
|||||||
count := 0
|
count := 0
|
||||||
if str.IsString(childValue) {
|
if str.IsString(childValue) {
|
||||||
module, _ := childValue.(string)
|
module, _ := childValue.(string)
|
||||||
|
if module == "" {
|
||||||
|
ll := list.NewLinkedList()
|
||||||
|
IterateBuiltinModules(func(name, description string, imported bool) bool {
|
||||||
|
ll.PushBack(name)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
v = ll
|
||||||
|
return
|
||||||
|
} else {
|
||||||
count, err = ImportInContextByGlobPattern(ctx, module)
|
count, err = ImportInContextByGlobPattern(ctx, module)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var moduleSpec any
|
var moduleSpec any
|
||||||
var it kern.Iterator
|
var it kern.Iterator
|
||||||
|
|||||||
Reference in New Issue
Block a user