@@ -112,6 +112,9 @@ function _parse_expression(stack, data, expr, x, parent_index)
112
112
if length (x. args) == 2 && ! isexpr (x. args[2 ], :... )
113
113
_parse_univariate_expression (stack, data, expr, x, parent_index)
114
114
else
115
+ # The call is either n-ary, or it is a splat, in which case we
116
+ # cannot tell just yet whether the expression is unary or nary.
117
+ # Punt to multivariate and try to recover later.
115
118
_parse_multivariate_expression (stack, data, expr, x, parent_index)
116
119
end
117
120
elseif isexpr (x, :comparison )
@@ -177,8 +180,15 @@ function _parse_multivariate_expression(
177
180
@assert isexpr (x, :call )
178
181
id = get (data. operators. multivariate_operator_to_id, x. args[1 ], nothing )
179
182
if id === nothing
180
- @assert x. args[1 ] in data. operators. comparison_operators
181
- _parse_inequality_expression (stack, data, expr, x, parent_index)
183
+ if haskey (data. operators. univariate_operator_to_id, x. args[1 ])
184
+ # It may also be a unary variate operator with splatting.
185
+ _parse_univariate_expression (stack, data, expr, x, parent_index)
186
+ elseif x. args[1 ] in data. operators. comparison_operators
187
+ # Or it may be a binary (in)equality operator.
188
+ _parse_inequality_expression (stack, data, expr, x, parent_index)
189
+ else
190
+ throw (MOI. UnsupportedNonlinearOperator (x. args[1 ]))
191
+ end
182
192
return
183
193
end
184
194
push! (expr. nodes, Node (NODE_CALL_MULTIVARIATE, id, parent_index))
0 commit comments