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

Method Adorn

parser/parser_test.cc:1354–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1352 : source_info_(source_info) {}
1353
1354 std::string Adorn(const cel::Expr& e) const override {
1355 // source_info_ might be empty on non-macro_calls tests
1356 if (source_info_.macro_calls_size() != 0 &&
1357 source_info_.macro_calls().contains(e.id())) {
1358 return absl::StrFormat(
1359 "^#%d:%s#", e.id(),
1360 source_info_.macro_calls().at(e.id()).call_expr().function());
1361 }
1362
1363 if (e.has_const_expr()) {
1364 auto& const_expr = e.const_expr();
1365 return absl::StrCat("^#", e.id(), ":", ConstantKind(const_expr), "#");
1366 } else {
1367 return absl::StrCat("^#", e.id(), ":", ExprKind(e), "#");
1368 }
1369 }
1370
1371 std::string AdornStructField(const cel::StructExprField& e) const override {
1372 return absl::StrFormat("^#%d:Expr.CreateStruct.Entry#", e.id());

Callers

nothing calls this directly

Calls 5

ConstantKindFunction · 0.85
ExprKindFunction · 0.85
atMethod · 0.80
has_const_exprMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected