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

Function CheckedExprToAstWithSource

cel/io.go:50–56  ·  view source on GitHub ↗

CheckedExprToAstWithSource converts a checked expression proto message to an Ast, using the provided Source as the textual contents. In general the source is not necessary unless the AST has been modified between the `Parse` and `Check` calls as an `Ast` created from the `Parse` step will carry the

(checkedExpr *exprpb.CheckedExpr, src Source)

Source from the content-addressed store, hash-verified

48//
49// Prefer CheckedExprToAst if loading expressions from storage.
50func CheckedExprToAstWithSource(checkedExpr *exprpb.CheckedExpr, src Source) (*Ast, error) {
51 checked, err := ast.ToAST(checkedExpr)
52 if err != nil {
53 return nil, err
54 }
55 return &Ast{source: src, impl: checked}, nil
56}
57
58// AstToCheckedExpr converts an Ast to an protobuf CheckedExpr value.
59//

Callers 2

CheckedExprToAstFunction · 0.85
TestAstToProtoFunction · 0.85

Calls 1

ToASTFunction · 0.92

Tested by 1

TestAstToProtoFunction · 0.68