Skip to content

Commit bd917f0

Browse files
committed
Print description in AbstractTrees.printnode()
1 parent 35ea296 commit bd917f0

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
@@ -2899,11 +2899,12 @@ function Base.showerror(io::IO, e::HybridSystemNotSupportedException)
28992899
print(io, "HybridSystemNotSupportedException: ", e.msg)
29002900
end
29012901

2902-
function AbstractTrees.children(sys::ModelingToolkit.AbstractSystem)
2902+
function AbstractTrees.children(sys::AbstractSystem)
29032903
ModelingToolkit.get_systems(sys)
29042904
end
2905-
function AbstractTrees.printnode(io::IO, sys::ModelingToolkit.AbstractSystem)
2905+
function AbstractTrees.printnode(io::IO, sys::AbstractSystem; describe = true)
29062906
print(io, nameof(sys))
2907+
describe && !isempty(get_description(sys)) && print(io, ": ", get_description(sys))
29072908
end
29082909
function Base.IteratorEltype(::Type{<:TreeIterator{ModelingToolkit.AbstractSystem}})
29092910
Base.HasEltype()

0 commit comments

Comments
 (0)