Skip to content

branch still counts the break/continue family: the unconditional transfers #2822 deferred #2832

Closed

Description

@squid-protocol

Deferred residue of #2822 (corollary 3: an unconditional transfer is not a decision) and corollary 2, kept out of that PR to hold one reviewable wave. The contract doc (docs/branch_rule_contract.md) links here.

Corollary 3 residue — the break/continue family. break/continue (c, cpp, csharp, java, javascript, typescript, go, php, dart, apex, kotlin, solidity, zig, powershell, lua, shell, dockerfile-shell, objective-c, ruby next/redo, perl next/last/redo, fortran EXIT/CYCLE, abap EXIT/CONTINUE, ada exit, go fallthrough, livecode next repeat) are unconditional transfers exactly like goto and return, but every rule above still counts them. They were deferred because they are uniform across the C family (so they do not currently break cross-language comparability the way goto did — no corpus cell reads out of band on them) and because the crucible volume is large (c alone: 259 break + 72 continue in the top-8 sample). The fix shape is #2822's: pure de-dup where another rule owns the token, relocation to structural_boundaries otherwise, one golden-master bless.

Corollary 2 residue — the two-keyword loop headers. A C-family do { } while (x) counts 2 (do + while); ada while X loop / for I in ... loop counts 2 (while/for + loop). Both are one construct. Not regex-fixable with a lookbehind (the condition sits between the keywords), so it needs either a paired-token guard in the slicer or a stated design note in the contract sheet. fortran's DO WHILE was fixable (WHILE only ever follows DO there) and was fixed in #2822 itself.

Neither shape currently produces an out-of-band corpus cell; this is crucible-level consistency debt, priced for one session with tests/tools/rule_probe.py before/after snapshots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-enginemetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions