From 81051d4c5742b26c6a111f432ea9e5714248efea Mon Sep 17 00:00:00 2001 From: Alessandro Date: Thu, 4 Nov 2021 19:59:29 +0100 Subject: [PATCH] fix similarterm --- src/expr.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/expr.jl b/src/expr.jl index 597d8c7..eec707d 100644 --- a/src/expr.jl +++ b/src/expr.jl @@ -19,6 +19,11 @@ function similarterm(x::Type{Expr}, head, args, symtype=nothing; metadata=nothin expr_similarterm(head, args, Val{exprhead}()) end +function similarterm(x::Expr, head, args, symtype=nothing; metadata=nothing, exprhead=exprhead(x)) + expr_similarterm(head, args, Val{exprhead}()) +end + + expr_similarterm(head, args, ::Val{:call}) = Expr(:call, head, args...) expr_similarterm(head, args, ::Val{:macrocall}) = Expr(:macrocall, head, args...) # discard linenumbernodes? expr_similarterm(head, args, ::Val{eh}) where {eh} = Expr(eh, args...)