Skip to content

Commit 238c835

Browse files
committed
added kw... to printnode
1 parent 781a01d commit 238c835

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/printing.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
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...)
55
66
Print a text representation of `tree` to the given `io` object.
77
@@ -82,7 +82,7 @@ Print a compact representation of a single node. By default, this prints `nodev
8282
**OPTIONAL**: This can be extended for custom types and controls how nodes are shown
8383
in [`print_tree`](@ref).
8484
"""
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))
8686

8787

8888
"""
@@ -192,10 +192,11 @@ function print_tree(printnode::Function, io::IO, node;
192192
printkeys::Union{Bool,Nothing}=nothing,
193193
depth::Integer=0,
194194
prefix::AbstractString="",
195+
kw...
195196
)
196197
# Get node representation as string
197198
buf = IOBuffer()
198-
printnode(IOContext(buf, io), node)
199+
printnode(IOContext(buf, io), node; kw...)
199200
str = String(take!(buf))
200201

201202
# Copy buffer to output, prepending prefix to each line

0 commit comments

Comments
 (0)