def compile(self): self.compiled = [] merged = None for ins in self.instructions: if len(ins) == 0: continue if merged != None: merged.append(ins) ins = ', '.join(merged) merged = None if ins[-1] != ')': merged = [ins] else: try: self.compiled.append(testeval(ins)) except: print self.descr + " - ERROR COMPILING: " + ins return False return True
def compile(self): self.compiled = [] merged = None for ins in self.instructions: if len (ins) == 0: continue if merged != None: merged.append(ins) ins = ', '.join(merged) merged = None if ins[-1] != ')': merged = [ins] else: try: self.compiled.append ( testeval (ins) ) except: print self.descr + " - ERROR COMPILING: " + ins return False return True
def __init__(self, rawtest): splitted = [e.strip("{ }\n\r") for e in rawtest.strip("{ }\n\r").split(",")] self.raw = splitted[1] self.len = int(splitted[0],0) try: self.parsed = to_signed_32(int(splitted[1],0)) except: self.parsed = None if not self.parsed: try: self.parsed = to_signed_32(testeval(splitted[1])) except: self.parsed = None
def __init__(self, rawtest): splitted = [ e.strip("{ }\n\r") for e in rawtest.strip("{ }\n\r").split(",") ] self.raw = splitted[1] self.len = int(splitted[0], 0) try: self.parsed = to_signed_32(int(splitted[1], 0)) except: self.parsed = None if not self.parsed: try: self.parsed = to_signed_32(testeval(splitted[1])) except: self.parsed = None