You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#337: break/continue outside a loop are compile errors
They compiled to silent no-ops (an explicit OP_NULL), so a mis-indented
break left its loop spinning with no diagnostic — including inside a
function body with no loop of its own. Both now report a compile error
via the existing post-compile g_parse_errors gate.
The gate is also enforced at every dynamic entry point: eval,
load_file, and import checked g_parse_errors only after PARSE, so
compile-stage diagnostics executed a placeholder chunk anyway. All
three now fail with a catchable error (the REPL and main already
gated).
Module-level return (ends the program, value discarded, exit 0) is now
documented in SPEC.md's Program model; the Loops section documents the
new compile error.
test_break_scope.eigs and test_control_flow_interactions.eigs pinned
the old tolerated-no-op shape; both rewritten to pin the actual
property (a callee's break never escapes to the caller's loop) using
functions that break their OWN loops.
Regression: suite [112] test_stray_break.eigs (eval'd stray
break/continue raise catchably; in-loop eval still works) + two
examples/errors/ demos gated by [90]. Release + ASan(detect_leaks=1)
2353/2353, leak tally 0.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments