1
0
forked from GitHub/gf-core

merge the states for reasoning and evaluation into a single structure

This commit is contained in:
krasimir
2015-07-03 11:53:52 +00:00
parent 1c2b6702d7
commit b3680b6025
14 changed files with 301 additions and 303 deletions

View File

@@ -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;
}