[pypy-svn] r44090 - in pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Thu Jun 7 14:23:35 CEST 2007
Author: cfbolz
Date: Thu Jun 7 14:23:34 2007
New Revision: 44090
Modified:
pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/compiler.py
pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/test_compiler.py
Log:
it seems compiling call to DYNAMIC_CALL is wrong
Modified: pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/compiler.py
==============================================================================
--- pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/compiler.py (original)
+++ pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/compiler.py Thu Jun 7 14:23:34 2007
@@ -91,8 +91,6 @@
self.compile_termbuilding(body.args[0])
self.compile_termbuilding(body.args[1])
self.emit_opcode(opcodedesc.UNIFY)
- elif body.signature == "call/1": #XXX interactions with cuts correct?
- self.compile_body(body.args[0])
elif body.signature == "!/0":
self.can_contain_cut = True
self.emit_opcode(opcodedesc.CUT)
Modified: pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/test_compiler.py
==============================================================================
--- pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/test_compiler.py (original)
+++ pypy/branch/prolog-bytecode/pypy/lang/prolog/interpreter/test/test_compiler.py Thu Jun 7 14:23:34 2007
@@ -65,8 +65,8 @@
head, body = get_query_and_vars("f(X, Y) :- X, call(Y).")[0].args
code = compile(head, body, e)
assert code.opcode_head == "l\x00\x00l\x00\x01t\x00\x00"
- assert code.opcode == "l\x00\x00Dl\x00\x01D"
- assert code.term_info == [("f", 2, "f/2")]
+ assert code.opcode.startswith("l\x00\x00Dl\x00\x01t\x00\x01b")
+ assert code.term_info == [("f", 2, "f/2"), ("call", 1, "call/1")]
assert code.can_contain_cut
def test_cut():
More information about the Pypy-commit
mailing list