diff --git a/src/macros.jl b/src/macros.jl index 37b42b10fa0..b979b743866 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -177,6 +177,7 @@ function parse_one_operator_constraint(_error::Function, vectorized::Bool, sense return parse_code, _build_call(_error, vectorized, :(_functionize($variable)), set) end +<<<<<<< HEAD function parse_constraint_expr(_error::Function, expr::Expr) return parse_constraint_head(_error, Val(expr.head), expr.args...) end @@ -187,6 +188,16 @@ end function parse_constraint(_error::Function, sense::Symbol, lhs, rhs) (sense, vectorized) = _check_vectorized(sense) vectorized, parse_one_operator_constraint(_error, vectorized, Val(sense), lhs, rhs)... +======= +function parse_constraint(_error::Function, ::Val{:call}, args...) + return parse_constraint(_error, Val(args[1]), args[2:end]...) +end + +function parse_constraint(_error::Function, sense::Val, F...) + sense_symbol = typeof(sense).parameters[1] + (sense, vectorized) = _check_vectorized(sense_symbol) + vectorized, parse_one_operator_constraint(_error, vectorized, Val(sense), F...)... +>>>>>>> e8c3cca8... New implementation of constraint programming. end function parse_ternary_constraint(_error::Function, vectorized::Bool, lb, ::Union{Val{:(<=)}, Val{:(≤)}}, aff, rsign::Union{Val{:(<=)}, Val{:(≤)}}, ub) @@ -209,11 +220,15 @@ function parse_ternary_constraint(_error::Function, args...) _error("Only two-sided rows of the form lb <= expr <= ub or ub >= expr >= lb are supported.") end +<<<<<<< HEAD function parse_constraint_head(_error::Function, ::Val{:comparison}, lb, lsign::Symbol, aff, rsign::Symbol, ub) return parse_constraint(_error, lb, lsign, aff, rsign, ub) end function parse_constraint(_error::Function, lb, lsign::Symbol, aff, rsign::Symbol, ub) +======= +function parse_constraint(_error::Function, ::Val{:comparison}, lb, lsign::Symbol, aff, rsign::Symbol, ub) +>>>>>>> e8c3cca8... New implementation of constraint programming. (lsign, lvectorized) = _check_vectorized(lsign) (rsign, rvectorized) = _check_vectorized(rsign) ((vectorized = lvectorized) == rvectorized) || _error("Signs are inconsistently vectorized")