|
1 | 1 | """ |
2 | | - print_tree(tree; kwargs...) |
3 | | - print_tree(io::IO, tree; kwargs...) |
4 | | - print_tree(f::Function, io::IO, tree; kwargs...) |
| 2 | + print_tree(tree; kw...) |
| 3 | + print_tree(io::IO, tree; kw...) |
| 4 | + print_tree(f::Function, io::IO, tree; kw...) |
5 | 5 |
|
6 | 6 | Print a text representation of `tree` to the given `io` object. |
7 | 7 |
|
@@ -82,7 +82,7 @@ Print a compact representation of a single node. By default, this prints `nodev |
82 | 82 | **OPTIONAL**: This can be extended for custom types and controls how nodes are shown |
83 | 83 | in [`print_tree`](@ref). |
84 | 84 | """ |
85 | | -printnode(io::IO, node) = show(IOContext(io, :compact => true, :limit => true), nodevalue(node)) |
| 85 | +printnode(io::IO, node; kw...) = show(IOContext(io, :compact => true, :limit => true), nodevalue(node)) |
86 | 86 |
|
87 | 87 |
|
88 | 88 | """ |
@@ -192,10 +192,11 @@ function print_tree(printnode::Function, io::IO, node; |
192 | 192 | printkeys::Union{Bool,Nothing}=nothing, |
193 | 193 | depth::Integer=0, |
194 | 194 | prefix::AbstractString="", |
| 195 | + kw... |
195 | 196 | ) |
196 | 197 | # Get node representation as string |
197 | 198 | buf = IOBuffer() |
198 | | - printnode(IOContext(buf, io), node) |
| 199 | + printnode(IOContext(buf, io), node; kw...) |
199 | 200 | str = String(take!(buf)) |
200 | 201 |
|
201 | 202 | # Copy buffer to output, prepending prefix to each line |
|
0 commit comments