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

Method Compile

cel/env.go:456–462  ·  view source on GitHub ↗

Compile combines the Parse and Check phases CEL program compilation to produce an Ast and associated issues. If an error is encountered during parsing the Compile step will not continue with the Check phase. If non-error issues are encountered during Parse, they may be combined with any issues disc

(txt string)

Source from the content-addressed store, hash-verified

454//
455// Note, for parse-only uses of CEL use Parse.
456func (e *Env) Compile(txt string) (*Ast, *Issues) {
457 src, err := common.NewTextSourceWithLimit(txt, e.configuredExpressionSizeLimit())
458 if err != nil {
459 return nil, ErrorAsIssues(err)
460 }
461 return e.CompileSource(src)
462}
463
464// CompileSource combines the Parse and Check phases CEL program compilation to produce an Ast and
465// associated issues.

Callers 15

TestNetwork_SuccessFunction · 0.95
TestListsRuntimeErrorsFunction · 0.95
TestListsVersionFunction · 0.95
TestTypeResolutionRaceFunction · 0.95
BenchmarkBindingsFunction · 0.95
TestStringsVersionsFunction · 0.95
TestStringCostTrackingFunction · 0.95

Calls 4

CompileSourceMethod · 0.95
NewTextSourceWithLimitFunction · 0.92
ErrorAsIssuesFunction · 0.85

Tested by 15

TestNetwork_SuccessFunction · 0.76
TestListsRuntimeErrorsFunction · 0.76
TestListsVersionFunction · 0.76
TestTypeResolutionRaceFunction · 0.76
BenchmarkBindingsFunction · 0.76
TestStringsVersionsFunction · 0.76
TestStringCostTrackingFunction · 0.76