public static BoundStatement If(SyntaxNode syntax, BoundExpression condition, BoundStatement thenStmt, BoundStatement?elseStmt, BoundLabel elseLabel, BoundLabel endLabel) { if (elseStmt == null) { return(If(syntax, condition, thenStmt, endLabel)); } return(Block(syntax, GotoFalse(syntax, elseLabel, condition), thenStmt, Goto(syntax, endLabel), Label(syntax, elseLabel), elseStmt, Label(syntax, endLabel))); }
public static BoundWhileStatement While(SyntaxNode syntax, BoundExpression condition, BoundStatement body, BoundLabel breakLabel, BoundLabel continueLabel) { return(new BoundWhileStatement(syntax, condition, body, breakLabel, continueLabel)); }
public static BoundStatement If(SyntaxNode syntax, BoundExpression condition, BoundStatement thenStmt, BoundLabel endLabel) { return(Block(syntax, GotoFalse(syntax, endLabel, condition), thenStmt, Label(syntax, endLabel))); }