125. Loops take an else that runs when no break left them (2026-11-21)
- Decision.
forandwhileaccept a trailingelse:block at the loop's indentation, with Python's meaning: it runs when the loop ends withoutbreak(labelledbreak 'outerfrom an inner loop also skips the inner loop'selse). Labelledbreak/continuestay as settled in 4.6. - Why. "Search, and handle not-found" is a common contest shape that
otherwise needs a
foundflag, which is a stale-state bug site. - Reverse. Delete the form; a codemod rewrites it to a flag.
- Status. Implemented (parser, checker, formatter, LSP, IR, interpreter, and C++17 codegen; parity test
crates/cpl-cli/tests/programs/loop_else.cp, fmt testformats_loop_else, LSP testfolding_ranges_cover_loop_else).