summaryrefslogtreecommitdiff
path: root/src/runtime/python
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2015-07-03 11:53:52 +0000
committerkrasimir <krasimir@chalmers.se>2015-07-03 11:53:52 +0000
commitb3680b60258372baa1d5e606026760ef223641b9 (patch)
tree3a3ee8d0facef3048dfdd2c316125d6083808fc7 /src/runtime/python
parent1c2b6702d74482713ca364f821319894073f67a2 (diff)
merge the states for reasoning and evaluation into a single structure
Diffstat (limited to 'src/runtime/python')
-rw-r--r--src/runtime/python/pypgf.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index cd4d2d26d..6fea65fd1 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -2484,24 +2484,26 @@ PGF_generateAll(PGFObject* self, PyObject *args, PyObject *keywds)
pyres->source = (PyObject*) self;
Py_INCREF(self);
+ GuPool* out_pool = gu_new_pool();
+
+ PyObject* py_pool = PyPool_New(out_pool);
+ pyres->container = PyTuple_Pack(2, pyres->source, py_pool);
+ Py_DECREF(py_pool);
+
pyres->pool = gu_new_pool();
pyres->max_count = max_count;
pyres->counter = 0;
pyres->fetch = Iter_fetch_expr;
- pyres->container = (PyObject*) pyres;
- GuPool *tmp_pool = gu_local_pool();
+ GuExn* err = gu_exn(pyres->pool);
pyres->res =
- pgf_generate_all(self->pgf, catname, pyres->pool);
+ pgf_generate_all(self->pgf, catname, err, pyres->pool, out_pool);
if (pyres->res == NULL) {
Py_DECREF(pyres);
- gu_pool_free(tmp_pool);
return NULL;
}
- gu_pool_free(tmp_pool);
-
return pyres;
}