refactored data-types to reduce plugin sizes
This commit is contained in:
+6
-4
@@ -7,6 +7,8 @@ package expr
|
||||
import (
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/scan"
|
||||
"git.portale-stac.it/go-pkg/expr/types/array"
|
||||
"git.portale-stac.it/go-pkg/expr/types/str"
|
||||
)
|
||||
|
||||
//-------- include term
|
||||
@@ -29,9 +31,9 @@ func evalInclude(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
}
|
||||
|
||||
count := 0
|
||||
if kern.IsList(childValue) {
|
||||
list, _ := childValue.(*kern.ListType)
|
||||
for i, filePathSpec := range *list {
|
||||
if array.IsList(childValue) {
|
||||
a, _ := childValue.(*array.ListType)
|
||||
for i, filePathSpec := range *a {
|
||||
if filePath, ok := filePathSpec.(string); ok {
|
||||
if v, err = EvalFile(ctx, filePath); err == nil {
|
||||
count++
|
||||
@@ -44,7 +46,7 @@ func evalInclude(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if kern.IsString(childValue) {
|
||||
} else if str.IsString(childValue) {
|
||||
filePath, _ := childValue.(string)
|
||||
if v, err = EvalFile(ctx, filePath); err == nil {
|
||||
count++
|
||||
|
||||
Reference in New Issue
Block a user