File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,13 @@ function _check_create_node(tree::AbstractExpressionNode)
226226 NT = with_type_parameters (N, Float16)
227227 return NT () isa NT
228228end
229+ function _check_children (tree:: AbstractExpressionNode{T,D} ) where {T,D}
230+ tree. degree == 0 && return true
231+ return children (tree) isa Tuple{typeof (tree),Vararg{typeof (tree)}} &&
232+ children (tree, Val (D)) isa Tuple &&
233+ length (children (tree, Val (D))) == D &&
234+ length (children (tree, Val (1 ))) == 1
235+ end
229236function _check_copy (tree:: AbstractExpressionNode )
230237 return copy (tree) isa typeof (tree)
231238end
360367ni_components = (
361368 mandatory = (
362369 create_node = " creates a new instance of the node type" => _check_create_node,
370+ children = " returns the children of the node" => _check_children,
363371 copy = " returns a copy of the tree" => _check_copy,
364372 hash = " returns the hash of the tree" => _check_hash,
365373 any = " checks if any element of the tree satisfies a condition" => _check_any,
You can’t perform that action at this time.
0 commit comments