Skip to content

Commit 9fa925a

Browse files
committed
Add compat methods to 0.20
1 parent 9bbd946 commit 9fa925a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SymbolicUtils"
22
uuid = "d1185830-fcd6-423d-90d6-eec64667417b"
33
authors = ["Shashi Gowda"]
4-
version = "0.19.7"
4+
version = "0.19.8"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/SymbolicUtils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export @syms, term, showraw, hasmetadata, getmetadata, setmetadata
88

99
using TermInterface
1010
using TermInterface: node_count
11+
import TermInterface: issym
1112
using Metatheory
1213
using Metatheory.Rules
1314
using Metatheory.Rewriters

src/types.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct Sym{T, M} <: Symbolic{T}
140140
metadata::M
141141
end
142142

143-
TermInterface.issym(s::Sym) = true
143+
issym(s::Sym) = true
144144
Base.nameof(s::Sym) = s.name
145145

146146
ConstructionBase.constructorof(s::Type{<:Sym{T}}) where {T} = (n,m) -> Sym{T}(n, metadata=m)
@@ -1165,3 +1165,10 @@ end
11651165

11661166
TermInterface.istree(t::Type{<:Sym}) = false
11671167
TermInterface.istree(t::Type{<:Symbolic}) = true
1168+
1169+
# Compat
1170+
isterm(s) = s isa Term
1171+
ismul(s) = s isa Mul
1172+
isadd(s) = s isa Add
1173+
ispow(s) = s isa Pow
1174+
isdiv(s) = s isa Div

0 commit comments

Comments
 (0)