From 301b1009887440a76cd7022dbb53bda4211d49db Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 6 Sep 2017 14:37:51 +0200 Subject: word completion in the C parser now returns information about the function which generates the token --- src/runtime/python/pypgf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/runtime/python') diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index 97718103b..56ee32876 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1163,7 +1163,10 @@ Iter_fetch_token(IterObject* self) PyObject* py_tok = PyString_FromString(tp->tok); PyObject* py_cat = PyString_FromString(tp->cat); - PyObject* res = Py_BuildValue("(f,O,O)", tp->prob, py_tok, py_cat); + PyObject* py_fun = PyString_FromString(tp->fun); + PyObject* res = Py_BuildValue("(f,O,O,O)", tp->prob, py_tok, py_cat, py_fun); + Py_DECREF(py_fun); + Py_DECREF(py_cat); Py_DECREF(py_tok); return res; -- cgit v1.2.3