Skip to content

Commit 7f6eedf

Browse files
committed
Implement LoopStateMachine
Utilities for returning state from functions that run inside a loop. This is used in e.g clipping, where we may need to break or transition states. The main entry point is to return an [`Action`](@ref) from a function that is wrapped in a `@controlflow f(...)` macro in a loop. When a known `Action` (currently, `Continue`, `Break`, `Return`, or `FullReturn`) is returned, it is processed by the `@controlflow` macro, which allows the function to break out of the loop early, continue to the next iteration, or return a value, without being syntactically inside the loop.
1 parent 18d923c commit 7f6eedf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ end
1111

1212
@safetestset "Types" begin include("types.jl") end
1313
@safetestset "Primitives" begin include("primitives.jl") end
14+
@safetestset "LoopStateMachine" begin include("utils/LoopStateMachine.jl") end
1415
# Methods
1516
@safetestset "Angles" begin include("methods/angles.jl") end
1617
@safetestset "Area" begin include("methods/area.jl") end

0 commit comments

Comments
 (0)