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

Method CompileSource

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

470//
471// Note, for parse-only uses of CEL use Parse.
472func (e *Env) CompileSource(src Source) (*Ast, *Issues) {
473 ast, iss := e.ParseSource(src)
474 if iss.Err() != nil {
475 return nil, iss
476 }
477 checked, iss2 := e.Check(ast)
478 if iss2.Err() != nil {
479 return nil, iss2
480 }
481 return checked, iss2
482}
483
484// Extend the current environment with additional options to produce a new Env.
485//

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