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

Method CompileSource

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

497//
498// Note, for parse-only uses of CEL use Parse.
499func (e *Env) CompileSource(src Source) (*Ast, *Issues) {
500 ast, iss := e.ParseSource(src)
501 if iss.Err() != nil {
502 return nil, iss
503 }
504 checked, iss2 := e.Check(ast)
505 if iss2.Err() != nil {
506 return nil, iss2
507 }
508 return checked, iss2
509}
510
511// Extend the current environment with additional options to produce a new Env.
512//

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