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

Method Compile

cel/env.go:499–505  ·  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

497//
498// Note, for parse-only uses of CEL use Parse.
499func (e *Env) Compile(txt string) (*Ast, *Issues) {
500 src, err := common.NewTextSourceWithLimit(txt, e.configuredExpressionSizeLimit())
501 if err != nil {
502 return nil, ErrorAsIssues(err)
503 }
504 return e.CompileSource(src)
505}
506
507// CompileSource combines the Parse and Check phases CEL program compilation to produce an Ast and
508// associated issues.

Callers 15

TestNetwork_SuccessFunction · 0.95
TestListsRuntimeErrorsFunction · 0.95
TestListsVersionFunction · 0.95
TestTypeResolutionRaceFunction · 0.95
BenchmarkBindingsFunction · 0.95
TestStringsVersionsFunction · 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