MCPcopy Create free account
hub / github.com/cel-expr/cel-go / CompileOptions

Method CompileOptions

ext/bindings.go:88–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88func (lib *celBindings) CompileOptions() []cel.EnvOption {
89 opts := []cel.EnvOption{
90 cel.Macros(
91 // cel.bind(var, <init>, <expr>)
92 cel.ReceiverMacro(bindMacro, 3, celBind),
93 ),
94 }
95 if lib.version >= 1 {
96 // The cel.@block signature takes a list of subexpressions and a typed expression which is
97 // used as the output type.
98 paramType := cel.TypeParamType("T")
99 opts = append(opts,
100 cel.Function("cel.@block",
101 cel.Overload("cel_block_list",
102 []*cel.Type{cel.ListType(cel.DynType), paramType}, paramType)),
103 )
104 opts = append(opts, cel.ASTValidators(blockValidationExemption{}))
105 }
106 return opts
107}
108
109func (lib *celBindings) ProgramOptions() []cel.ProgramOption {
110 if lib.version >= 1 {

Callers

nothing calls this directly

Calls 5

MacrosFunction · 0.92
ReceiverMacroFunction · 0.92
FunctionFunction · 0.92
OverloadFunction · 0.92
ASTValidatorsFunction · 0.92

Tested by

no test coverage detected