pyrser/ast/state.py
def resetLivingState(self):
        """Only one Living State on the S0 of each StateRegister"""
        # TODO: add some test to control number of instanciation of LivingState
        # clean all living state on S0
        must_delete = []
        l = len(self.ls)
        for idx, ls in zip(range(l), self.ls):
            # TODO: alive by default on False, change to True on the first match
            ids = id(ls[1].thestate())
            if ids == id(ls[0]) and (ls[1].have_finish or not ls[1].alive):
                must_delete.append(idx)
            elif ls[1].alive:
                ls[1].alive = False
        for delete in reversed(must_delete):
            self.ls.pop(delete)
        self.init_all()
def resetLivingState(self):
        """Only one Living State on the S0 of each StateRegister"""
        # TODO: add some test to control number of instanciation of LivingState
        # clean all living state on S0
        must_delete = []
        l = len(self.ls)
        for idx, ls in zip(range(l), self.ls):
            # TODO: alive by default on False, change to True on the first match
            ids = id(ls[1].thestate())
            if ids == id(ls[0]) and (ls[1].have_finish or not ls[1].alive):
                must_delete.append(idx)
            elif ls[1].alive:
                ls[1].alive = False
        for delete in reversed(must_delete):
            self.ls.pop(delete)
        self.init_all()
def resetLivingState ( self ) : # TODO: add some test to control number of instanciation of LivingState # clean all living state on S0 must_delete = [ ] l = len ( self . ls ) for idx , ls in zip ( range ( l ) , self . ls ) : # TODO: alive by default on False, change to True on the first match ids = id ( ls [ 1 ] . thestate ( ) ) if ids == id ( ls [ 0 ] ) and ( ls [ 1 ] . have_finish or not ls [ 1 ] . alive ) : must_delete . append ( idx ) elif ls [ 1 ] . alive : ls [ 1 ] . alive = False for delete in reversed ( must_delete ) : self . ls . pop ( delete ) self . init_all ( )
Only one Living State on the S0 of each StateRegister
Only one Living State on the S0 of each StateRegister