language · language ·
Loop, next, and end
loop creates an explicit indefinite loop. next skips to the next iteration and end exits the nearest loop.
Use loop for event pumps or retry flows with clear exit points. Use while when one condition explains the whole lifetime.
loop { ... }
next
endStatus: stable
Controlled indefinite loop
Use loop for event pumps or retry flows with clear exit points. Use while when one condition explains the whole lifetime.
cpu · language · type checked
int attempt = 0
loop
{
attempt = attempt + 1
if attempt < 3 { next }
Console.Log("Connected")
end
}
project.mech
manifestVersion = "2"
package = "api.example.language__infinite_loop_control"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Notes and source
next and end target the nearest active loop.
The historical endLoops token is not supported.
yeho/parser_statements.cpp parseLoopStatement and parseLoopControlStatement