[pypy-svn] r44076 - in pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Thu Jun 7 11:40:13 CEST 2007
Author: cfbolz
Date: Thu Jun 7 11:40:13 2007
New Revision: 44076
Modified:
pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/engine.py
pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/interpreter.py
pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/tool.py
Log:
more tests passing
Modified: pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/engine.py
==============================================================================
--- pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/engine.py (original)
+++ pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/engine.py Thu Jun 7 11:40:13 2007
@@ -164,9 +164,8 @@
rule = Query(query, self)
frame = rule.make_frame()
try:
- cont = frame.run_directly(continuation)
- while cont is not None:
- cont = cont._call(self)
+ #import pdb;pdb.set_trace()
+ frame.run_directly(continuation)
except CutException, e:
return self.continue_after_cut(e.continuation)
Modified: pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/interpreter.py
==============================================================================
--- pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/interpreter.py (original)
+++ pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/interpreter.py Thu Jun 7 11:40:13 2007
@@ -65,7 +65,9 @@
self.stack = None
def run_directly(self, continuation):
- return self.run(self.code.opcode, 0, continuation)
+ cont = self.run(self.code.opcode, 0, continuation)
+ while cont is not None:
+ cont = cont._call(self.engine)
def run(self, bytecode, pc, continuation):
stack = []
@@ -150,7 +152,8 @@
rule = rulechain.rule
try:
frame = rule.make_frame(query)
- return frame.run_directly(continuation)
+ frame.run_directly(continuation)
+ return
except error.UnificationFailed:
self.engine.heap.revert(oldstate)
rule = rulechain.rule
Modified: pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/tool.py
==============================================================================
--- pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/tool.py (original)
+++ pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/tool.py Thu Jun 7 11:40:13 2007
@@ -33,7 +33,6 @@
raise UnificationFailed
def collect_all(engine, s):
- py.test.skip("collect_all currently does not work")
terms, vars = engine.parse(s)
term, = terms
collector = CollectAllContinuation(vars)
More information about the Pypy-commit
mailing list