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

Method CompileSource

cel/env.go:515–525  ·  view source on GitHub ↗

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

(src Source)

Source from the content-addressed store, hash-verified

513//
514// Note, for parse-only uses of CEL use Parse.
515func (e *Env) CompileSource(src Source) (*Ast, *Issues) {
516 ast, iss := e.ParseSource(src)
517 if iss.Err() != nil {
518 return nil, iss
519 }
520 checked, iss2 := e.Check(ast)
521 if iss2.Err() != nil {
522 return nil, iss2
523 }
524 return checked, iss2
525}
526
527// Extend the current environment with additional options to produce a new Env.
528//

Callers 4

CompileMethod · 0.95
CreateASTMethod · 0.80
compileRuleMethod · 0.80

Calls 3

ParseSourceMethod · 0.95
CheckMethod · 0.95
ErrMethod · 0.80

Tested by

no test coverage detected