From def31aac8481fbfaa8947b3a5de58d5f56353c39 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Fri, 27 Aug 2021 17:30:56 +0200 Subject: [PATCH] fixed bug in similarterm, version bump --- Project.toml | 2 +- src/TermInterface.jl | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 65cd7fe..cc3dad6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TermInterface" uuid = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c" authors = ["Shashi Gowda ", "Alessandro Cheli "] -version = "0.1.6" +version = "0.1.7" [compat] julia = "1" diff --git a/src/TermInterface.jl b/src/TermInterface.jl index 64cd1f7..f0505de 100644 --- a/src/TermInterface.jl +++ b/src/TermInterface.jl @@ -93,12 +93,9 @@ and `metadata` as the metadata. By default this will execute `head(args...)`. similarterm(x, head, args, symtype=nothing; metadata=nothing) = similarterm(typeof(x), head, args, symtype; metadata=metadata) -similarterm(x, head, args; metadata=nothing) = - similarterm(typeof(x), head, args; metadata=metadata) - - similarterm(x::Type{Expr}, head, args, symtype=nothing; metadata=nothing) = Expr(head, args...) -function similarterm(x::Type{T}, head::T, args, symtype=nothing; metadata=nothing) where T + +function similarterm(x::Type{T}, head, args, symtype=nothing; metadata=nothing) where T if !istree(T) head else head(args...) end end export similarterm