diff --git a/src/animation.jl b/src/animation.jl index 3c55967c..cb09e527 100644 --- a/src/animation.jl +++ b/src/animation.jl @@ -137,8 +137,8 @@ end # ----------------------------------------------- function _animate(forloop::Expr, args...; callgif = false) - if forloop.head != :for - error("@animate macro expects a for-block. got: $(forloop.head)") + if forloop.head ∉ (:for, :while) + error("@animate macro expects a for- or while-block. got: $(forloop.head)") end # add the call to frame to the end of each iteration