while loops

This commit is contained in:
uan
2026-02-07 15:48:59 +01:00
parent 58f0dfa969
commit 9d26256023
5 changed files with 47 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
module main
import strings
@@ -158,6 +159,12 @@ fn (mut g Generator) gen_stmt(stmt Stmt) {
g.out.write_string(') ')
g.gen_stmt(stmt.block)
}
WhileLoop {
g.out.write_string('while (')
g.gen_expr(stmt.guard)
g.out.write_string(') ')
g.gen_stmt(stmt.block)
}
}
}