|
83 | 83 |
|
84 | 84 |
|
85 | 85 | """
|
86 |
| - similarterm(x, head, args; type=nothing, metadata=nothing) |
| 86 | + similarterm(x, head, args, symtype=nothing; metadata=nothing) |
87 | 87 |
|
88 | 88 | Returns a term that is in the same closure of types as `typeof(x)`,
|
89 | 89 | with `head` as the head and `args` as the arguments, `type` as the symtype
|
90 | 90 | and `metadata` as the metadata. By default this will execute `head(args...)`.
|
91 | 91 | `x` parameter can also be a `Type`.
|
92 | 92 | """
|
93 |
| -similarterm(x, head, args; type=nothing, metadata=nothing) = |
94 |
| - similarterm(typeof(x), head, args; type=type, metadata=nothing) |
95 |
| -similarterm(x::Type{Expr}, head, args; type=nothing, metadata=nothing) = Expr(head, args...) |
96 |
| -function similarterm(x::Type{T}, head::T, args; type=nothing, metadata=nothing) where T |
| 93 | +similarterm(x, head, args, symtype=nothing; metadata=nothing) = |
| 94 | + similarterm(typeof(x), head, args, type; metadata=nothing) |
| 95 | + |
| 96 | +similarterm(x::Type{Expr}, head, args, symtype=nothing; metadata=nothing) = Expr(head, args...) |
| 97 | +function similarterm(x::Type{T}, head::T, args, symtype=nothing; metadata=nothing) where T |
97 | 98 | if !isterm(T) head else head(args...) end
|
98 | 99 | end
|
99 | 100 | export similarterm
|
100 | 101 |
|
| 102 | +include("utils.jl") |
| 103 | + |
101 | 104 | end # module
|
102 | 105 |
|
0 commit comments