Skip to content

Commit bf6c403

Browse files
committed
feat: add is_node_constant to interface
1 parent 1d86cc2 commit bf6c403

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Interfaces.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ using ..NodeModule:
2626
filter_map!
2727
using ..NodeUtilsModule:
2828
NodeIndex,
29+
is_node_constant,
2930
count_constants,
3031
count_depth,
3132
index_constants,
@@ -273,6 +274,9 @@ end
273274
function _check_count_depth(tree::AbstractExpressionNode)
274275
return count_depth(tree) isa Int64
275276
end
277+
function _check_is_node_constant(tree::AbstractExpressionNode)
278+
return is_node_constant(tree) isa Bool
279+
end
276280
function _check_count_constants(tree::AbstractExpressionNode)
277281
return count_constants(tree) isa Int64
278282
end
@@ -324,6 +328,7 @@ ni_components = (
324328
branch_hash = "computes the hash of a branch node" => _check_branch_hash,
325329
branch_equal = "checks equality of two branch nodes" => _check_branch_equal,
326330
count_depth = "calculates the depth of the tree" => _check_count_depth,
331+
is_node_constant = "checks if the node is a constant" => _check_is_node_constant,
327332
count_constants = "counts the number of constants" => _check_count_constants,
328333
filter_map = "applies a filter and map function to the tree" => _check_filter_map,
329334
has_constants = "checks if the tree has constants" => _check_has_constants,

0 commit comments

Comments
 (0)