diff --git a/src/printing.jl b/src/printing.jl index 1830ba0462122c80d9b790f67ffb216bb4e4912d..a026eb7082463f9de60a839358b1d0bb3d605f94 100644 --- a/src/printing.jl +++ b/src/printing.jl @@ -25,7 +25,11 @@ _robust_value(other) = other function Base.show(io::IO, block::AbstractBlock) - print(io, nameof(typeof(block)), "(") + show_block(io, block, 0) +end + +function show_block(io::IO, block::AbstractBlock, nspaces::Int64) + print(io, nameof(typeof(block)), "(\n") for name in propertynames(block) value = _robust_value(getproperty(block, name)) if ( @@ -39,7 +43,13 @@ function Base.show(io::IO, block::AbstractBlock) continue end - print(io, name, "=", repr(getproperty(block, name)), ", ") + print(io, repeat(' ', nspaces + 2), name, "=") + if value isa AbstractBlock + show_block(io, value, nspaces + 2) + else + print(io, repr(value)) + end + print(io, ",\n") end print(io, ")") end