@@ -12,6 +12,12 @@ import DynamicExpressions: AbstractExpression, get_tree, get_operators
1212const SYMBOLIC_UTILS_TYPES = Union{<: Number ,SymbolicUtils. Symbolic{<: Number }}
1313const SUPPORTED_OPS = (cos, sin, exp, cot, tan, csc, sec, + , - , * , / )
1414
15+ @static if isdefined (SymbolicUtils, :iscall )
16+ iscall (x) = SymbolicUtils. iscall (x)
17+ else
18+ iscall (x) = SymbolicUtils. istree (x)
19+ end
20+
1521macro return_on_false (flag, retval)
1622 :(
1723 if ! $ (esc (flag))
@@ -21,7 +27,7 @@ macro return_on_false(flag, retval)
2127end
2228
2329function is_valid (x:: SymbolicUtils.Symbolic )
24- return if SymbolicUtils . iscall (x)
30+ return if iscall (x)
2531 all (is_valid .([SymbolicUtils. operation (x); SymbolicUtils. arguments (x)]))
2632 else
2733 true
@@ -140,7 +146,7 @@ function Base.convert(
140146 variable_names:: Union{Array{String,1},Nothing} = nothing ,
141147) where {N<: AbstractExpressionNode }
142148 variable_names = deprecate_varmap (variable_names, nothing , :convert )
143- if ! SymbolicUtils . iscall (expr)
149+ if ! iscall (expr)
144150 variable_names === nothing && return constructorof (N)(String (expr. name))
145151 return constructorof (N)(String (expr. name), variable_names)
146152 end
@@ -234,7 +240,7 @@ function multiply_powers(eqn::Number)::Tuple{SYMBOLIC_UTILS_TYPES,Bool}
234240end
235241
236242function multiply_powers (eqn:: SymbolicUtils.Symbolic ):: Tuple{SYMBOLIC_UTILS_TYPES,Bool}
237- if ! SymbolicUtils . iscall (eqn)
243+ if ! iscall (eqn)
238244 return eqn, true
239245 end
240246 op = SymbolicUtils. operation (eqn)
0 commit comments