@@ -7,12 +7,13 @@ TSLanguage *tree_sitter_fsharp_signature(void);
77
88static PyObject * _binding_language_fsharp (PyObject * Py_UNUSED (self ),
99 PyObject * Py_UNUSED (args )) {
10- return PyLong_FromVoidPtr (tree_sitter_fsharp ());
10+ return PyCapsule_New (tree_sitter_fsharp (), "tree_sitter.Language" , NULL );
1111}
1212
1313static PyObject * _binding_language_fsharp_signature (PyObject * Py_UNUSED (self ),
1414 PyObject * Py_UNUSED (args )) {
15- return PyLong_FromVoidPtr (tree_sitter_fsharp_signature ());
15+ return PyCapsule_New (tree_sitter_fsharp_signature (), "tree_sitter.Language" ,
16+ NULL );
1617}
1718
1819static struct PyModuleDef_Slot slots [] = {
@@ -22,10 +23,10 @@ static struct PyModuleDef_Slot slots[] = {
2223 {0 , NULL }};
2324
2425static PyMethodDef methods [] = {
25- {"fsharp " , _binding_language_fsharp , METH_NOARGS ,
26+ {"language_fsharp " , _binding_language_fsharp , METH_NOARGS ,
2627 "Get the tree-sitter language for FSharp." },
27- {"signature " , _binding_language_fsharp_signature , METH_NOARGS ,
28- "Get the tree-sitter language for FSharp interfaces." },
28+ {"language_fsharp_signature " , _binding_language_fsharp_signature ,
29+ METH_NOARGS , "Get the tree-sitter language for FSharp interfaces." },
2930 {NULL , NULL , 0 , NULL }};
3031
3132static struct PyModuleDef module = {
0 commit comments