def test_delitem(self): a = ir.DelItem(self.var_a, self.var_b, self.loc1) b = ir.DelItem(self.var_a, self.var_b, self.loc1) c = ir.DelItem(self.var_a, self.var_b, self.loc2) d = ir.DelItem(self.var_c, self.var_b, self.loc1) e = ir.DelItem(self.var_a, self.var_c, self.loc1) self.check(a, same=[b, c], different=[d, e])
def op_DELETE_SLICE_3(self, inst, base, start, stop, slicevar, indexvar): base = self.get(base) start = self.get(start) stop = self.get(stop) slicegv = ir.Global("slice", slice, loc=self.loc) self.store(value=slicegv, name=slicevar) index = ir.Expr.call(self.get(slicevar), (start, stop), (), loc=self.loc) self.store(value=index, name=indexvar) stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) self.current_block.append(stmt)
def op_DELETE_SLICE_0(self, inst, base, slicevar, indexvar, nonevar): base = self.get(base) slicegv = ir.Global("slice", slice, loc=self.loc) self.store(value=slicegv, name=slicevar) nonegv = ir.Const(None, loc=self.loc) self.store(value=nonegv, name=nonevar) none = self.get(nonevar) index = ir.Expr.call(self.get(slicevar), (none, none), (), loc=self.loc) self.store(value=index, name=indexvar) stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) self.current_block.append(stmt)
def op_DELETE_SUBSCR(self, inst, target, index): index = self.get(index) target = self.get(target) stmt = ir.DelItem(target=target, index=index, loc=self.loc) self.current_block.append(stmt)