Break
On this page

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/core/ir'

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

const Break: () => void

Return 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
})

See also

Source

src/core/ir/builder.ts, line 1473, at commit af54ddad5

Edit this page Report a problem