-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1134 from k1LoW/move-eval-internal
Move eval to internal/eval
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package runn | ||
package eval | ||
|
||
import ( | ||
"fmt" | ||
|