Commit d15e2eb4 authored by 's avatar

untabified

parent 353161fd
......@@ -169,13 +169,13 @@ class CodeBlock:
self.munge(subcode, depth+1)
# Make the current recursion depth accessible
self.depth = depth
code = fc.co_code
code = fc.co_code
warnings, errors = self.warnings, self.errors
# Initialize the Munge objects
mungers = []
mungers = []
window = Munge_window(code, 1)
margs = (self, window, fc)
for M in self.Mungers:
margs = (self, window, fc)
for M in self.Mungers:
try:
mungers.append(apply(M, margs))
except Exception, e:
......@@ -569,15 +569,15 @@ def test(p, c):
return sb
if __name__ == '__main__':
sb = test('x', '''\
sb = test('x', '''\
print x
def plus1(x):
print x+1
plus1(x)
return printed''')
f = UntupleFunction(sb.t, {})
#from dis import dis
#dis(f)
print f(2),
print f(3),
#from dis import dis
#dis(f)
print f(2),
print f(3),
......@@ -14,7 +14,7 @@ from cyclehandle import CycleHandle
class CodeString(CycleHandle):
def __init__(self,cs=None,bytecodes=None):
self._set_workers(CodeStringWorker(cs, bytecodes))
self._set_workers(CodeStringWorker(cs, bytecodes))
class CodeStringWorker:
def __init__(self,cs,bytecodes):
......@@ -159,7 +159,7 @@ class CodeStringWorker:
class EditableCode(CycleHandle):
def __init__(self,code=None):
self._set_workers(EditableCodeWorker(code))
self._set_workers(EditableCodeWorker(code))
class EditableCodeWorker:
# bits for co_flags
......@@ -276,8 +276,8 @@ class EditableCodeWorker:
class Function(CycleHandle):
def __init__(self,func=None):
self._set_workers(FunctionWorker(func))
self._set_workers(FunctionWorker(func))
class FunctionWorker:
def __init__(self,func):
if func is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment