From 547d307fc7d650d1cf3407cbd7e1a419c1c1c0dc Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:50:37 +0100 Subject: [PATCH] PROPOSALS: continue accepted, the step before it Its example puts the loop's step first, and says what a step after a continue does; what it costs. concha's Csyntax among those met. --- diff --git a/PROPOSALS.md b/PROPOSALS.md index 4182caf..dc95b6c 100644 --- a/PROPOSALS.md +++ b/PROPOSALS.md @@ -412,12 +412,38 @@ ``` The proposal: `continue`, in a `while`, `repeat` or `for`, ends the -round, as reaching the end of the body would: a `for` steps its -variable, `repeat` tests its condition. A deferred statement can't -hold it, as it can't hold `break`. It breaks a program that has a name -`continue`, so it waits for a thaw. +round, as reaching the end of the body would: a `while` tests its +condition again, a `repeat` tests its `until`, a `for` steps its +variable. A deferred statement can't hold it, as it can't hold +`break`. With it, the loop above reads: -Met in libro and rml, more than once each. +``` +while i < LEN(t) do + ch, n := Str.decode(t[i..LEN(t)]); + i := i + n; (* the step first *) + if ch = 0ADH then continue; end; (* passed over *) + ... +end; +``` + +The step comes before any `continue`. Put after it, as `i := i + n` +stood in the first loop, it is skipped, `i` never moves, and the loop +never ends; a `repeat`'s `until` may likewise read what the skipped +rest of the body was to set. A `for` steps itself and has neither +trap. The report's example shows the step first, and the compiler +can't catch it. + +It costs about 15 lines of the compiler (a second chain of jumps +beside `break`'s, fixed at each loop's test or step), a few lines of +the report (7.2, the reserved words, the grammar, 7.7), and a word in +`tools/Scan.raz` and the editors' modes. It breaks a program that has +a name `continue`; none of the raz programs written so far has one. + +Accepted by the owner, for a thaw. + +Met in libro and rml, more than once each, and in concha's +`Csyntax`, whose `interpolate` reads `elsif (c # '$') or not try +dollar(...)` for want of it. ## A byte into an `INT`