Break()
Function in Authoring
Push a break; onto the innermost scope, exiting the nearest enclosing Loop outright, under the same nesting rule as Continue: an If nested inside the loop is not itself a break boundary.
import { Break } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
const Break: () => voidReturn value
void
Examples
Example
Loop(u32(0), (i) => i.lt(u32(72)), () => { const d = Let(length(p).sub(1)) If(d.lt(0.001), () => Break()) // hit: stop marching})In the guide
See also
Source
src/core/ir/builder.ts, line 1750, at commit 26de7be8