Skip to content

Commit

Permalink
Add optional sorting to arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Jun 17, 2024
1 parent 43797eb commit 678bce8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ end

@inline head(x::BasicSymbolic) = operation(x)

function arguments(x::BasicSymbolic)
function arguments(x::BasicSymbolic, sort::Bool = false)
args = unsorted_arguments(x)
if !sort
return args
end
@compactified x::BasicSymbolic begin
Add => @goto ADD
Mul => @goto MUL
Expand Down Expand Up @@ -809,7 +812,7 @@ function show_term(io::IO, t)
end

f = operation(t)
args = arguments(t)
args = arguments(t, true)
if symtype(t) <: LiteralReal
show_call(io, f, args)
elseif f === (+)
Expand Down

0 comments on commit 678bce8

Please sign in to comment.