@@ -12,6 +12,12 @@ import DynamicExpressions: AbstractExpression, get_tree, get_operators
12
12
const SYMBOLIC_UTILS_TYPES = Union{<: Number ,SymbolicUtils. Symbolic{<: Number }}
13
13
const SUPPORTED_OPS = (cos, sin, exp, cot, tan, csc, sec, + , - , * , / )
14
14
15
+ @static if isdefined (SymbolicUtils, :iscall )
16
+ iscall (x) = SymbolicUtils. iscall (x)
17
+ else
18
+ iscall (x) = SymbolicUtils. istree (x)
19
+ end
20
+
15
21
macro return_on_false (flag, retval)
16
22
:(
17
23
if ! $ (esc (flag))
@@ -21,7 +27,7 @@ macro return_on_false(flag, retval)
21
27
end
22
28
23
29
function is_valid (x:: SymbolicUtils.Symbolic )
24
- return if SymbolicUtils . iscall (x)
30
+ return if iscall (x)
25
31
all (is_valid .([SymbolicUtils. operation (x); SymbolicUtils. arguments (x)]))
26
32
else
27
33
true
@@ -140,7 +146,7 @@ function Base.convert(
140
146
variable_names:: Union{Array{String,1},Nothing} = nothing ,
141
147
) where {N<: AbstractExpressionNode }
142
148
variable_names = deprecate_varmap (variable_names, nothing , :convert )
143
- if ! SymbolicUtils . iscall (expr)
149
+ if ! iscall (expr)
144
150
variable_names === nothing && return constructorof (N)(String (expr. name))
145
151
return constructorof (N)(String (expr. name), variable_names)
146
152
end
@@ -234,7 +240,7 @@ function multiply_powers(eqn::Number)::Tuple{SYMBOLIC_UTILS_TYPES,Bool}
234
240
end
235
241
236
242
function multiply_powers (eqn:: SymbolicUtils.Symbolic ):: Tuple{SYMBOLIC_UTILS_TYPES,Bool}
237
- if ! SymbolicUtils . iscall (eqn)
243
+ if ! iscall (eqn)
238
244
return eqn, true
239
245
end
240
246
op = SymbolicUtils. operation (eqn)
0 commit comments