Skip to content

Commit

Permalink
Merge pull request #1134 from k1LoW/move-eval-internal
Browse files Browse the repository at this point in the history
Move eval to internal/eval
  • Loading branch information
k1LoW authored Dec 25, 2024
2 parents 85c668e + 730c946 commit 8930f9e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions alias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package runn

import (
"github.com/k1LoW/runn/internal/eval"
"github.com/k1LoW/runn/internal/exprtrace"
)

func EvalWithTrace(e string, store exprtrace.EvalEnv) (*exprtrace.EvalResult, error) {
return eval.EvalWithTrace(e, store)
}

func Eval(e string, store exprtrace.EvalEnv) (any, error) {
return eval.Eval(e, store)
}

// EvalAny evaluate any type. but, EvalAny do not evaluate map key.
func EvalAny(e any, store exprtrace.EvalEnv) (any, error) {
return eval.EvalAny(e, store)
}

func EvalCond(cond string, store exprtrace.EvalEnv) (bool, error) {
return eval.EvalCond(cond, store)
}

func EvalCount(count string, store exprtrace.EvalEnv) (int, error) {
return eval.EvalCount(count, store)
}

// EvalExpand evaluates `in` and expand `{{ }}` in `in` using `store`.
func EvalExpand(in any, store exprtrace.EvalEnv) (any, error) {
return eval.EvalExpand(in, store)
}
4 changes: 2 additions & 2 deletions eval.go → internal/eval/eval.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runn
package eval

import (
"fmt"
Expand All @@ -15,8 +15,8 @@ import (
"github.com/goccy/go-yaml"
"github.com/k1LoW/expand"
"github.com/k1LoW/runn/builtin"
"github.com/k1LoW/runn/internal/exprtrace"
"github.com/k1LoW/runn/internal/deprecation"
"github.com/k1LoW/runn/internal/exprtrace"
"github.com/xlab/treeprint"
)

Expand Down
2 changes: 1 addition & 1 deletion eval_test.go → internal/eval/eval_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runn
package eval

import (
"fmt"
Expand Down

0 comments on commit 8930f9e

Please sign in to comment.