Skip to content

Commit f3603ff

Browse files
committed
Add pretty-printing for context stacks
1 parent e75fd1e commit f3603ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/contexts.jl

+5
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,8 @@ function prefix_cond_and_fixed_variables(
817817
context, prefix_cond_and_fixed_variables(childcontext(context), prefix)
818818
)
819819
end
820+
821+
_pretty(ctx::AbstractContext) = split(string(ctx), "Context")[1]
822+
pretty_context(ctx::AbstractContext) = pretty_context(NodeTrait(ctx), ctx)
823+
pretty_context(::IsLeaf, ctx) = _pretty(ctx)
824+
pretty_context(::IsParent, ctx) = _pretty(ctx) * "->" * pretty_context(childcontext(ctx))

0 commit comments

Comments
 (0)