mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-06 14:48:48 +00:00
tree sitter update
This commit is contained in:
parent
c0377d1a1b
commit
aaabbb5d6a
22 changed files with 505 additions and 45 deletions
27
bindings/python/tree_sitter_lang/binding.c
generated
Normal file
27
bindings/python/tree_sitter_lang/binding.c
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <Python.h>
|
||||
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
||||
TSLanguage *tree_sitter_lang(void);
|
||||
|
||||
static PyObject* _binding_language(PyObject *self, PyObject *args) {
|
||||
return PyLong_FromVoidPtr(tree_sitter_lang());
|
||||
}
|
||||
|
||||
static PyMethodDef methods[] = {
|
||||
{"language", _binding_language, METH_NOARGS,
|
||||
"Get the tree-sitter language for this grammar."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static struct PyModuleDef module = {
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "_binding",
|
||||
.m_doc = NULL,
|
||||
.m_size = -1,
|
||||
.m_methods = methods
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC PyInit__binding(void) {
|
||||
return PyModule_Create(&module);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue