Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/tree-sitter-omega/blob/main/bindings/python/tree_sitter_omega/binding.c # tree-sitter-omega aien-dev/tree-sitter-omega Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `tree-sitter-omega / bindings / python / tree_sitter_omega / binding.c` 35 lines ยท 834 bytes Raw Blame History 1 #include 2 3 typedef struct TSLanguage TSLanguage; 4 5 TSLanguage *tree_sitter_omega(void); 6 7 static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { 8 return PyCapsule_New(tree_sitter_omega(), "tree_sitter.Language", NULL); 9 } 10 11 static struct PyModuleDef_Slot slots[] = { 12 #ifdef Py_GIL_DISABLED 13 {Py_mod_gil, Py_MOD_GIL_NOT_USED}, 14 #endif 15 {0, NULL} 16 }; 17 18 static PyMethodDef methods[] = { 19 {"language", _binding_language, METH_NOARGS, 20 "Get the tree-sitter language for this grammar."}, 21 {NULL, NULL, 0, NULL} 22 }; 23 24 static struct PyModuleDef module = { 25 .m_base = PyModuleDef_HEAD_INIT, 26 .m_name = "_binding", 27 .m_doc = NULL, 28 .m_size = 0, 29 .m_methods = methods, 30 .m_slots = slots, 31 }; 32 33 PyMODINIT_FUNC PyInit__binding(void) { 34 return PyModuleDef_Init(&module); 35 }