Skip to content

Commit 77025da

Browse files
committed
Print description in AbstractTrees.printnode()
1 parent 699fa62 commit 77025da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/abstractsystem.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,11 +2901,12 @@ function Base.showerror(io::IO, e::HybridSystemNotSupportedException)
29012901
print(io, "HybridSystemNotSupportedException: ", e.msg)
29022902
end
29032903

2904-
function AbstractTrees.children(sys::ModelingToolkit.AbstractSystem)
2904+
function AbstractTrees.children(sys::AbstractSystem)
29052905
ModelingToolkit.get_systems(sys)
29062906
end
2907-
function AbstractTrees.printnode(io::IO, sys::ModelingToolkit.AbstractSystem)
2907+
function AbstractTrees.printnode(io::IO, sys::AbstractSystem; describe = true)
29082908
print(io, nameof(sys))
2909+
describe && !isempty(get_description(sys)) && print(io, ": ", get_description(sys))
29092910
end
29102911
function Base.IteratorEltype(::Type{<:TreeIterator{ModelingToolkit.AbstractSystem}})
29112912
Base.HasEltype()

0 commit comments

Comments
 (0)