private bool EmitBranchable(IRppNode expr, Label targetLabel, bool onTrue) { ClrCodegen nestedCodegen = new ClrCodegen(_body, targetLabel, onTrue) {ClosureContext = ClosureContext}; expr.Accept(nestedCodegen); return nestedCodegen.Jumped; }
private void EmitBranchableAndJumpOnResult(IRppNode expr, Label targetLabel, bool onTrue) { bool notJumped = !EmitBranchable(expr, targetLabel, onTrue); if (notJumped) { _body.Emit(onTrue ? OpCodes.Brtrue : OpCodes.Brfalse, targetLabel); } Jumped = true; }
public RppWhile(IRppExpr condition, IRppNode body) { Condition = condition; Body = body; Type = ResolvableType.UnitTy; }