Skip to content

Commit

Permalink
Return sorted arguments in AbstractTrees.children for printing
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Jun 17, 2024
1 parent e8d04c1 commit df8f204
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/inspect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ function AbstractTrees.nodevalue(x::BasicSymbolic)
Text(str)
end

"""
$(TYPEDSIGNATURES)
Return the children of the symbolic expression `x`, sorted by their order in
the expression.
This function is used internally for printing via AbstractTrees.
"""
function AbstractTrees.children(x::Symbolic)
iscall(x) ? arguments(x) : isexpr(x) ? children(x) : ()
iscall(x) ? arguments(x, true) : isexpr(x) ? children(x) : ()
end

"""
Expand Down

0 comments on commit df8f204

Please sign in to comment.