Ticket #2112: builtins.c.patch
File builtins.c.patch, 829 bytes (added by , 14 years ago) |
---|
-
builtins.c
1659 1659 FRAME inner[1]; 1660 1660 LIST *result; 1661 1661 PARSE *p; 1662 PyObject *python_result; 1662 1663 char* rulename; 1664 int i; 1663 1665 1664 1666 /* Build up the list of arg lists */ 1665 1667 … … 1709 1711 result = evaluate_rule( rulename, inner ); 1710 1712 1711 1713 frame_free( inner ); 1714 1715 python_result = PyList_New(list_length(result)); 1716 for (i = 0; result; result = list_next(result), ++i) 1717 PyList_SetItem(python_result, i, PyString_FromString(result->string)); 1712 1718 1713 Py_INCREF(Py_None); 1714 return Py_None; 1719 list_free(result); 1720 1721 return python_result; 1715 1722 } 1716 1723 1717 1724 /** Accepts three arguments: module name, rule name and Python callable.