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

Function MakeTestParsedAst

checker/internal/test_ast_helpers.cc:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace cel::checker_internal {
28
29absl::StatusOr<std::unique_ptr<Ast>> MakeTestParsedAst(
30 absl::string_view expression) {
31 static const cel::Parser* parser = []() {
32 cel::ParserOptions options = {.enable_optional_syntax = true};
33 auto parser = NewParserBuilder(options)->Build();
34 ABSL_CHECK_OK(parser);
35 return parser->release();
36 }();
37
38 CEL_ASSIGN_OR_RETURN(
39 auto source,
40 cel::NewSource(expression, /*description=*/std::string(expression)));
41 return parser->Parse(*source);
42}
43
44} // namespace cel::checker_internal

Callers 7

TEST_PFunction · 0.85
TESTFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85

Calls 4

NewParserBuilderFunction · 0.85
BuildMethod · 0.45
releaseMethod · 0.45
ParseMethod · 0.45

Tested by

no test coverage detected