MakeHas expands the input call arguments into a presence test, e.g. has( .field)
(eh ExprHelper, target ast.Expr, args []ast.Expr)
| 548 | |
| 549 | // MakeHas expands the input call arguments into a presence test, e.g. has(<operand>.field) |
| 550 | func MakeHas(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { |
| 551 | if args[0].Kind() == ast.SelectKind { |
| 552 | s := args[0].AsSelect() |
| 553 | return eh.NewPresenceTest(s.Operand(), s.FieldName()), nil |
| 554 | } |
| 555 | return nil, eh.NewError(args[0].ID(), "invalid argument to has() macro") |
| 556 | } |
| 557 | |
| 558 | func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { |
| 559 | v, found := extractIdent(args[0]) |