fix break

This commit is contained in:
nora 2023-07-30 21:04:29 +02:00
parent 0bf9aed35e
commit 1dad80f4c1
6 changed files with 70 additions and 33 deletions

View file

@ -127,19 +127,17 @@ export type ExprIf = {
else?: Expr;
};
export type LoopId = number;
export type ExprLoop = {
kind: "loop";
body: Expr;
loopId: LoopId;
};
export type ExprBreak = {
kind: "break";
/**
* The break target block.
* May be any control flow block, labelled from inside out.
* TODO: This is not a good solution at all and pretty broken.
*/
target?: number;
target?: LoopId;
};
export type ExprStructLiteral = {