while loops
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user