Break
이 페이지에서

Break()

함수, 작성 분류

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'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const Break: () => void

반환값

void

예제

예제

Loop(u32(0), (i) => i.lt(u32(72)), () => {
const d = Let(length(p).sub(1))
If(d.lt(0.001), () => Break()) // hit: stop marching
})

관련 가이드

함께 보기

소스

src/core/ir/builder.ts, 1750행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고