Skip to content

Commit bb9ecf9

Browse files
Merge pull request #3486 from AayushSabharwal/as/jumpsys-hack
fix: fix jump system hack
2 parents a9f776b + 90a8dd6 commit bb9ecf9

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

src/systems/jumps/jumpsystem.jl

+7-18
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,14 @@ const JumpType = Union{VariableRateJump, ConstantRateJump, MassActionJump}
44
# call reset_aggregated_jumps!(integrator).
55
# assumes iip
66
function _reset_aggregator!(expr, integrator)
7-
if expr isa Symbol
8-
error("Error, encountered a symbol. This should not happen.")
7+
@assert Meta.isexpr(expr, :function)
8+
body = expr.args[end]
9+
body = quote
10+
$body
11+
$reset_aggregated_jumps!($integrator)
912
end
10-
if expr isa LineNumberNode
11-
return
12-
end
13-
14-
if (expr.head == :function)
15-
_reset_aggregator!(expr.args[end], integrator)
16-
else
17-
if expr.args[end] == :nothing
18-
expr.args[end] = :(reset_aggregated_jumps!($integrator))
19-
push!(expr.args, :nothing)
20-
else
21-
_reset_aggregator!(expr.args[end], integrator)
22-
end
23-
end
24-
25-
nothing
13+
expr.args[end] = body
14+
return nothing
2615
end
2716

2817
"""

0 commit comments

Comments
 (0)