Skip to content

Commit 08de25a

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 958153452
1 parent 1c4f3fc commit 08de25a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tools/proto_to_predicate.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,14 @@ class ProtoToPredicateBuilder final : private ExprFactory {
429429
Expr field_path = NewSelect(NextId(), base_expr, field->name());
430430
CEL_RETURN_IF_ERROR(Walk(sub_message, field_path, predicates));
431431
} else {
432-
// Primitive field: base_expr.field == <value>
433-
Expr field_path = NewSelect(NextId(), base_expr, field->name());
432+
// Primitive field: base_expr.field == <value> or match_path == <value>
433+
Expr field_path;
434+
std::string match_path_val = GetMatchPath(field);
435+
if (!match_path_val.empty()) {
436+
field_path = ParseAndBuildPath(match_path_val);
437+
} else {
438+
field_path = NewSelect(NextId(), base_expr, field->name());
439+
}
434440
predicates.push_back(
435441
ConstructEquality(std::move(field_path),
436442
PrimitiveToExpr(message, reflection, field)));

0 commit comments

Comments
 (0)