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

Method CompileSource

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

577//
578// Note, for parse-only uses of CEL use Parse.
579func (e *Env) CompileSource(src Source) (*Ast, *Issues) {
580 ast, iss := e.ParseSource(src)
581 if iss.Err() != nil {
582 return nil, iss
583 }
584 checked, iss2 := e.Check(ast)
585 if iss2.Err() != nil {
586 return nil, iss2
587 }
588 return checked, iss2
589}
590
591// Extend the current environment with additional options to produce a new Env.
592//

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