MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Compile

Method Compile

compiler/compiler_factory.cc:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 validator_(std::move(validator)) {}
51
52 absl::StatusOr<ValidationResult> Compile(
53 absl::string_view expression,
54 absl::string_view description) const override {
55 CEL_ASSIGN_OR_RETURN(auto source,
56 cel::NewSource(expression, std::string(description)));
57 CEL_ASSIGN_OR_RETURN(auto ast, parser_->Parse(*source));
58 CEL_ASSIGN_OR_RETURN(ValidationResult result,
59 type_checker_->Check(std::move(ast)));
60
61 result.SetSource(std::move(source));
62 if (!validator_.validations().empty()) {
63 validator_.UpdateValidationResult(result);
64 }
65 return result;
66 }
67
68 std::unique_ptr<CompilerBuilder> ToBuilder() const override;
69

Callers

nothing calls this directly

Calls 4

SetSourceMethod · 0.80
validationsMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected