MCPcopy Index your code
hub / github.com/expr-lang/expr / Patch

Function Patch

expr.go:145–149  ·  view source on GitHub ↗

Patch adds visitor to list of visitors what will be applied before compiling AST to bytecode.

(visitor ast.Visitor)

Source from the content-addressed store, hash-verified

143
144// Patch adds visitor to list of visitors what will be applied before compiling AST to bytecode.
145func Patch(visitor ast.Visitor) Option {
146 return func(c *conf.Config) {
147 c.Visitors = append(c.Visitors, visitor)
148 }
149}
150
151// Function adds function to list of functions what will be available in expressions.
152func Function(name string, fn func(params ...any) (any, error), types ...any) Option {

Callers 12

ExamplePatchFunction · 0.92
TestPatchFunction · 0.92
TestPatch_lengthFunction · 0.92
TestPatch_change_identFunction · 0.92
TestPatch_CountFunction · 0.92
TestPatchOperator_CountFunction · 0.92
TestPatch_SetTypeFunction · 0.92
TestWithContextFunction · 0.92
TimezoneFunction · 0.70
patchWithTypeFunction · 0.50
patchCopyTypeFunction · 0.50

Calls

no outgoing calls

Tested by 9

ExamplePatchFunction · 0.74
TestPatchFunction · 0.74
TestPatch_lengthFunction · 0.74
TestPatch_change_identFunction · 0.74
TestPatch_CountFunction · 0.74
TestPatchOperator_CountFunction · 0.74
TestPatch_SetTypeFunction · 0.74
TestWithContextFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…