That "fix" wasn't a fix.
It broke other stuff. What I really wanted to do was change the stack effect of 'clear'.
This commit is contained in:
parent
20d87db9d5
commit
c4af5682c4
|
|
@ -355,15 +355,10 @@ def type_check(name, stack):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return # None, indicating unknown
|
return # None, indicating unknown
|
||||||
|
|
||||||
stack = _foo_stack(stack)
|
|
||||||
|
|
||||||
for fi, fo in infer(func):
|
for fi, fo in infer(func):
|
||||||
try:
|
try:
|
||||||
U = unify(fi, stack)
|
U = unify(fi, stack)
|
||||||
except JoyTypeError, e:
|
except (JoyTypeError, ValueError), e:
|
||||||
#print e
|
|
||||||
continue
|
|
||||||
except ValueError, e:
|
|
||||||
#print >> sys.stderr, name, e, stack
|
#print >> sys.stderr, name, e, stack
|
||||||
continue
|
continue
|
||||||
#print U
|
#print U
|
||||||
|
|
@ -371,16 +366,6 @@ def type_check(name, stack):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _foo_stack(stack, s=None):
|
|
||||||
if s is None:
|
|
||||||
s = (StackJoyType(n) for n in xrange(23, 100))
|
|
||||||
if stack == ():
|
|
||||||
return next(s)
|
|
||||||
if isinstance(stack, tuple):
|
|
||||||
return tuple(_foo_stack(inner, s) for inner in stack)
|
|
||||||
return stack
|
|
||||||
|
|
||||||
|
|
||||||
a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 = A
|
a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 = A
|
||||||
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 = B
|
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 = B
|
||||||
n0, n1, n2, n3, n4, n5, n6, n7, n8, n9 = N
|
n0, n1, n2, n3, n4, n5, n6, n7, n8, n9 = N
|
||||||
|
|
@ -414,7 +399,7 @@ def defs():
|
||||||
|
|
||||||
sum_ = product = [(((Ns[1], s1), s0), (n0, s0))]
|
sum_ = product = [(((Ns[1], s1), s0), (n0, s0))]
|
||||||
|
|
||||||
clear = [((As[1], s0), s1)]
|
clear = [(s0, s1)]
|
||||||
|
|
||||||
add = mul = sub = floordiv = modulus = [
|
add = mul = sub = floordiv = modulus = [
|
||||||
((i2, (i1, s0)), (i3, s0)),
|
((i2, (i1, s0)), (i3, s0)),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue