ExistsMacroExpander expands the input call arguments into a comprehension that returns true if any of the elements in the range match the predicate expressions: .exists( , )
(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr)
| 229 | // elements in the range match the predicate expressions: |
| 230 | // <iterRange>.exists(<iterVar>, <predicate>) |
| 231 | func ExistsMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { |
| 232 | ph, err := toParserHelper(meh) |
| 233 | if err != nil { |
| 234 | return nil, err |
| 235 | } |
| 236 | out, err := parser.MakeExists(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) |
| 237 | if err != nil { |
| 238 | return nil, err |
| 239 | } |
| 240 | return adaptToProto(out) |
| 241 | } |
| 242 | |
| 243 | // ExistsOneMacroExpander expands the input call arguments into a comprehension that returns true if exactly |
| 244 | // one of the elements in the range match the predicate expressions: |