~oontvoo/+junk/test_hw

« back to all changes in this revision

Viewing changes to src/jminusminus/JBooleanBinaryExpression.java

  • Committer: vnguyen
  • Date: 2013-05-09 20:11:19 UTC
  • Revision ID: oontvoo@hotmail.com-20130509201119-0kha5n03ca929puk
- add DoUntil, DoUnless
- implement Logical OR

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
                {
147
147
                    if (onTrue)
148
148
                    {
149
 
                        lhs.codegen(output, targetLabel, false);
150
 
                        rhs.codegen(output, targetLabel, false);
 
149
                        lhs.codegen(output, targetLabel, true);
 
150
                        rhs.codegen(output, targetLabel, true);
151
151
                    }
152
152
                    else
153
153
                    {   
154
 
                        String falseLabel = output.createLabel();
155
 
                        lhs.codegen(output, falseLabel, false);
156
 
                        rhs.codegen(output, targetLabel, true);
157
 
                        output.addLabel(falseLabel);
 
154
                        String trueLabel = output.createLabel();
 
155
                        lhs.codegen(output, trueLabel, true);
 
156
                        rhs.codegen(output, targetLabel, false);
 
157
                        output.addLabel(trueLabel);
158
158
                    }
159
159
                }
160
160
            };