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

Method Compile

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

481//
482// Note, for parse-only uses of CEL use Parse.
483func (e *Env) Compile(txt string) (*Ast, *Issues) {
484 src, err := common.NewTextSourceWithLimit(txt, e.configuredExpressionSizeLimit())
485 if err != nil {
486 return nil, ErrorAsIssues(err)
487 }
488 return e.CompileSource(src)
489}
490
491// CompileSource combines the Parse and Check phases CEL program compilation to produce an Ast and
492// 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