@@ -186,8 +186,8 @@ include("base.jl")
186186
187187# ! format: off
188188@inline function (:: Type{N} )(
189- :: Type{T1} = Undefined; val= nothing , feature= nothing , op= nothing , l= nothing , r= nothing , children= nothing , allocator= default_allocator,
190- ) where {T1,N<: AbstractExpressionNode }
189+ :: Type{T1} = Undefined; val= nothing , feature= nothing , op= nothing , l= nothing , r= nothing , children= nothing , allocator:: F = default_allocator,
190+ ) where {T1,N<: AbstractExpressionNode ,F }
191191 if children != = nothing
192192 @assert l === nothing && r === nothing
193193 if length (children) == 1
@@ -200,8 +200,8 @@ include("base.jl")
200200end
201201""" Create a constant leaf."""
202202@inline function node_factory (
203- :: Type{N} , :: Type{T1} , val:: T2 , :: Nothing , :: Nothing , :: Nothing , :: Nothing , allocator
204- ) where {N,T1,T2}
203+ :: Type{N} , :: Type{T1} , val:: T2 , :: Nothing , :: Nothing , :: Nothing , :: Nothing , allocator:: F ,
204+ ) where {N,T1,T2,F }
205205 T = node_factory_type (N, T1, T2)
206206 n = allocator (N, T)
207207 n. degree = 0
211211end
212212""" Create a variable leaf, to store data."""
213213@inline function node_factory (
214- :: Type{N} , :: Type{T1} , :: Nothing , feature:: Integer , :: Nothing , :: Nothing , :: Nothing , allocator,
215- ) where {N,T1}
214+ :: Type{N} , :: Type{T1} , :: Nothing , feature:: Integer , :: Nothing , :: Nothing , :: Nothing , allocator:: F ,
215+ ) where {N,T1,F }
216216 T = node_factory_type (N, T1, DEFAULT_NODE_TYPE)
217217 n = allocator (N, T)
218218 n. degree = 0
222222end
223223""" Create a unary operator node."""
224224@inline function node_factory (
225- :: Type{N} , :: Type{T1} , :: Nothing , :: Nothing , op:: Integer , l:: AbstractExpressionNode{T2} , :: Nothing , allocator,
226- ) where {N,T1,T2}
225+ :: Type{N} , :: Type{T1} , :: Nothing , :: Nothing , op:: Integer , l:: AbstractExpressionNode{T2} , :: Nothing , allocator:: F ,
226+ ) where {N,T1,T2,F }
227227 @assert l isa N
228228 T = T2 # Always prefer existing nodes, so we don't mess up references from conversion
229229 n = allocator (N, T)
234234end
235235""" Create a binary operator node."""
236236@inline function node_factory (
237- :: Type{N} , :: Type{T1} , :: Nothing , :: Nothing , op:: Integer , l:: AbstractExpressionNode{T2} , r:: AbstractExpressionNode{T3} , allocator,
238- ) where {N,T1,T2,T3}
237+ :: Type{N} , :: Type{T1} , :: Nothing , :: Nothing , op:: Integer , l:: AbstractExpressionNode{T2} , r:: AbstractExpressionNode{T3} , allocator:: F ,
238+ ) where {N,T1,T2,T3,F }
239239 T = promote_type (T2, T3)
240240 n = allocator (N, T)
241241 n. degree = 2
0 commit comments