Skip to content

Commit 69cd372

Browse files
committed
docs: tweak docstring
1 parent f9d21c6 commit 69cd372

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/ExtensionInterface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ function bumper_eval_tree_array(args...)
2727
end
2828
function bumper_kern! end
2929

30-
_is_loopvectorization_loaded(_) = false
30+
_is_loopvectorization_loaded(_) = false # COV_EXCL_LINE
3131

3232
end

src/Node.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ const DEFAULT_MAX_DEGREE = 2
1111
"""
1212
AbstractNode{D}
1313
14-
Abstract type for D-arity trees. Must have the following fields:
14+
Abstract type for trees which can have up to `D` children per node.
15+
Must have the following fields:
1516
1617
- `degree::UInt8`: Degree of the node. This should be a value
17-
between 0 and `DEFAULT_MAX_DEGREE`.
18-
- `children`: A collection of D references to children nodes.
18+
between 0 and `D`, inclusive.
19+
- `children`: A collection of up to `D` children nodes. The number
20+
of children which are _active_ is given by the `degree` field,
21+
but for type stability reasons, you can have inactive children.
1922
2023
# Deprecated fields
2124
@@ -250,12 +253,14 @@ end
250253
Base.eltype(::Type{<:AbstractExpressionNode{T}}) where {T} = T
251254
Base.eltype(::AbstractExpressionNode{T}) where {T} = T
252255

256+
# COV_EXCL_START
253257
max_degree(::Type{<:AbstractNode}) = DEFAULT_MAX_DEGREE
254258
max_degree(::Type{<:AbstractNode{D}}) where {D} = D
255259
max_degree(node::AbstractNode) = max_degree(typeof(node))
256260

257261
has_max_degree(::Type{<:AbstractNode}) = false
258262
has_max_degree(::Type{<:AbstractNode{D}}) where {D} = true
263+
# COV_EXCL_STOP
259264

260265
@unstable function constructorof(::Type{N}) where {N<:Node}
261266
return Node{T,max_degree(N)} where {T}
@@ -358,8 +363,8 @@ end
358363
eltype(N)
359364
end
360365
end
361-
defines_eltype(::Type{<:AbstractExpressionNode}) = false
362-
defines_eltype(::Type{<:AbstractExpressionNode{T}}) where {T} = true
366+
defines_eltype(::Type{<:AbstractExpressionNode}) = false # COV_EXCL_LINE
367+
defines_eltype(::Type{<:AbstractExpressionNode{T}}) where {T} = true # COV_EXCL_LINE
363368
#! format: on
364369

365370
function (::Type{N})(

0 commit comments

Comments
 (0)