Skip to content

Commit

Permalink
sort the typetree printed by the example code
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Dec 31, 2013
1 parent b1e003b commit 3828c2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/typetree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function store_all_from(m::Module)
t = eval(m,expr)
isa(t, Type) && store_type(string(expr), t)
#catch ex
# println("Error adding ", string(expr), " ", t, " ", m, " (", ex, ")")
# println("Error adding ", string(expr), m, " (", ex, ")")
end
end
end
Expand All @@ -95,7 +95,8 @@ type_props(typ::DataType) = string("<<",
" >>")

function print_tree(subtypes::Dict{String, TTNode}, pfx::String="")
for (n,v) in subtypes
for n in sort!([keys(subtypes)...])
v = subtypes[n]
if(n == string(v.typ))
println(pfx, "+- ", n, " ", type_props(v.typ))
else
Expand Down

0 comments on commit 3828c2d

Please sign in to comment.