Skip to content

Commit

Permalink
Rename expr function from 'getExprValue' to '$patcher_value_getter'.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrb3942 committed Dec 4, 2023
1 parent fe53377 commit c979721
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patchers/value/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
"github.com/antonmedv/expr/conf"

Check failure on line 52 in patchers/value/value.go

View workflow job for this annotation

GitHub Actions / test (1.18)

no required module provides package github.com/antonmedv/expr/conf; to add it:

Check failure on line 52 in patchers/value/value.go

View workflow job for this annotation

GitHub Actions / coverage

no required module provides package github.com/antonmedv/expr/conf; to add it:

Check failure on line 52 in patchers/value/value.go

View workflow job for this annotation

GitHub Actions / test (1.19)

no required module provides package github.com/antonmedv/expr/conf; to add it:

Check failure on line 52 in patchers/value/value.go

View workflow job for this annotation

GitHub Actions / test (1.20)

no required module provides package github.com/antonmedv/expr/conf; to add it:
)

// Patcher is an expr.Option that both patches the program and adds the `getExprValue` function.
// Patcher is an expr.Option that both patches the program and adds the `$patcher_value_getter` function.
// Use it directly as an Option to expr.Compile()
var Patcher = func() expr.Option {
vPatcher := patcher{}
Expand Down Expand Up @@ -178,7 +178,7 @@ func (patcher) Visit(node *ast.Node) {
for _, t := range supportedInterfaces {
if nodeType.Implements(t) {
callnode := &ast.CallNode{
Callee: &ast.IdentifierNode{Value: "getExprValue"},
Callee: &ast.IdentifierNode{Value: "$patcher_value_getter"},
Arguments: []ast.Node{id},
}

Expand Down Expand Up @@ -236,7 +236,7 @@ func getExprValue(params ...any) (any, error) {
return params[0], nil
}

var getExprValueFunc = expr.Function("getExprValue", getExprValue,
var getExprValueFunc = expr.Function("$patcher_value_getter", getExprValue,
new(func(BoolValuer) bool),
new(func(IntValuer) int),
new(func(Int8Valuer) int8),
Expand Down

0 comments on commit c979721

Please sign in to comment.