@@ -96,9 +96,15 @@ struct TreeCharSet
9696 trunc
9797end
9898
99- # Default charset
100- TreeCharSet () = TreeCharSet (' ├' ,' └' ,' │' ,' ─' ,' ⋮' )
101- TreeCharSet (mid, term, skip, dash) = TreeCharSet (mid, term, skip, dash, ' ⋮' )
99+ """ Default `charset` argument used by [`print_tree`](@ref)."""
100+ const DEFAULT_CHARSET = TreeCharSet (' ├' , ' └' , ' │' , ' ─' , ' ⋮' )
101+ """ Charset using only ASCII characters."""
102+ const ASCII_CHARSET = TreeCharSet (" +" , " \\ " , " |" , " --" , " ..." )
103+
104+ function TreeCharSet ()
105+ Base. depwarn (" The 0-argument constructor of TreeCharSet is deprecated, use AbstractTrees.DEFAULT_CHARSET instead." , :TreeCharSet )
106+ return DEFAULT_CHARSET
107+ end
102108
103109
104110"""
@@ -116,7 +122,7 @@ function print_prefix(io::IO, depth::Int, charset::TreeCharSet, active_levels)
116122end
117123
118124function _print_tree (printnode:: Function , io:: IO , tree; maxdepth = 5 , indicate_truncation = true ,
119- depth = 0 , active_levels = Int[], charset = TreeCharSet () , withinds = false ,
125+ depth = 0 , active_levels = Int[], charset = DEFAULT_CHARSET , withinds = false ,
120126 inds = [], from = nothing , to = nothing , roottree = tree)
121127 nodebuf = IOBuffer ()
122128 isa (io, IOContext) && (nodebuf = IOContext (nodebuf, io))
0 commit comments