Ignore:
Timestamp:
Jul 28, 2010, 4:46:27 PM (9 years ago)
Author:
eamiri
Message:

If statement introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/bitexpr.py

    r454 r545  
     1# -*- coding: utf-8 -*-
    12
    23class Pragma:
     
    148149
    149150class WhileLoop(StmtList):
    150     def __init__(self, expr, stmts):
     151    def __init__(self, expr, stmts, fake = False):
    151152        self.control_expr = expr
    152153        self.carry_expr = None
    153154        StmtList.__init__(self, stmts)
     155        self.fake = fake
    154156        #self.stmt = stmts
    155157    def show(self):
    156158        rslt = ''
    157159        for s in self.loop_body: rslt += s.show() + '\n'
    158         return 'while (%s) {%s}' % (self.control_expr.show(), rslt)
     160        if (not fake): return 'while (%s) {%s}' % (self.control_expr.show(), rslt)
     161        else: return 'if (%s) {%s}' % (self.control_expr.show(), rslt)
    159162
    160163
Note: See TracChangeset for help on using the changeset viewer.