public override void visit_loop_statement (LoopStatement stmt) {
write_indent ();
- write_string ("loop");
+ write_string ("while (");
+ stmt.condition.accept (this);
+ write_string (")");
stmt.body.accept (this);
write_newline ();
}
* @return newly created while statement
*/
public LoopStatement (Block body, SourceReference? source_reference = null) {
- base (null, body, source_reference);
+ base (new BooleanLiteral (true, source_reference), body, source_reference);
}
public override void accept (CodeVisitor visitor) {
checked = true;
+ condition.check (context);
body.check (context);
return !error;