Exemple #1
0
 private bool EmitBranchable(IRppNode expr, Label targetLabel, bool onTrue)
 {
     ClrCodegen nestedCodegen = new ClrCodegen(_body, targetLabel, onTrue) {ClosureContext = ClosureContext};
     expr.Accept(nestedCodegen);
     return nestedCodegen.Jumped;
 }
Exemple #2
0
        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;
        }
Exemple #3
0
 public RppWhile(IRppExpr condition, IRppNode body)
 {
     Condition = condition;
     Body = body;
     Type = ResolvableType.UnitTy;
 }