From c9797215aab8a4f000e1eeb1c00edf660c2b8592 Mon Sep 17 00:00:00 2001 From: Ryan Bullock Date: Mon, 4 Dec 2023 11:09:15 -0800 Subject: [PATCH] Rename expr function from 'getExprValue' to '$patcher_value_getter'. --- patchers/value/value.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patchers/value/value.go b/patchers/value/value.go index 019a2800..286f2524 100644 --- a/patchers/value/value.go +++ b/patchers/value/value.go @@ -52,7 +52,7 @@ import ( "github.com/antonmedv/expr/conf" ) -// 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{} @@ -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}, } @@ -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),