Skip to content

Commit 38e5f6a

Browse files
committed
Merge remote-tracking branch 'origin/master' into b/611-migrate-to-exproniconjl-v08-from-unityperjl
2 parents 53ca3b8 + 835fb0d commit 38e5f6a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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 = "3.7.0"
4+
version = "3.7.1"
55

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

src/substitute.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ Base.occursin(needle, haystack::Symbolic) = _occursin(needle, haystack)
5454
Base.occursin(needle::Symbolic, haystack) = _occursin(needle, haystack)
5555
function _occursin(needle, haystack)
5656
isequal(needle, haystack) && return true
57-
5857
if iscall(haystack)
5958
args = arguments(haystack)
6059
for arg in args
61-
occursin(needle, arg) && return true
60+
if needle isa Integer || needle isa AbstractFloat
61+
isequal(needle, arg) && return true
62+
else
63+
occursin(needle, arg) && return true
64+
end
6265
end
6366
end
6467
return false

test/basics.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ end
185185
@test occursin(a, a + b)
186186
@test !occursin(sin(a), a + b + c)
187187
@test occursin(sin(a), a * b + c + sin(a^2 * sin(a)))
188+
@test occursin(0.01, 0.01*a)
189+
@test !occursin(0.01, a * b * c)
188190
end
189191

190192
@testset "printing" begin

0 commit comments

Comments
 (0)