ExistsOneMacroExpander expands the input call arguments into a comprehension that returns true if exactly one of the elements in the range match the predicate expressions: .exists_one( , )
(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr)
| 244 | // one of the elements in the range match the predicate expressions: |
| 245 | // <iterRange>.exists_one(<iterVar>, <predicate>) |
| 246 | func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) { |
| 247 | ph, err := toParserHelper(meh) |
| 248 | if err != nil { |
| 249 | return nil, err |
| 250 | } |
| 251 | out, err := parser.MakeExistsOne(ph, mustAdaptToExpr(target), mustAdaptToExprs(args)) |
| 252 | if err != nil { |
| 253 | return nil, err |
| 254 | } |
| 255 | return adaptToProto(out) |
| 256 | } |
| 257 | |
| 258 | // MapMacroExpander expands the input call arguments into a comprehension that transforms each element in the |
| 259 | // input to produce an output list. |