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)
| 48 | // |
| 49 | // Prefer CheckedExprToAst if loading expressions from storage. |
| 50 | func 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 | // |