From 7c9e0e129e720c448180521a07a419a4a0cc7ef9 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 5 Feb 2026 21:13:50 +0000 Subject: [PATCH 1/2] Fix doubled tree_sitter_ prefix in Python binding The scaffolding tool generated tree_sitter_tree_sitter_vb_dotnet() but parser.c exports tree_sitter_vb_dotnet(). This caused an undefined symbol error on import. --- bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c b/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c index 8122c88..08e4018 100644 --- a/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c +++ b/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c @@ -2,10 +2,10 @@ typedef struct TSLanguage TSLanguage; -TSLanguage *tree_sitter_tree_sitter_vb_dotnet(void); +TSLanguage *tree_sitter_vb_dotnet(void); static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { - return PyCapsule_New(tree_sitter_tree_sitter_vb_dotnet(), "tree_sitter.Language", NULL); + return PyCapsule_New(tree_sitter_vb_dotnet(), "tree_sitter.Language", NULL); } static struct PyModuleDef_Slot slots[] = { From 1fa5b49be698f66bdb2c4e85860106bf1a9eec6e Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 5 Feb 2026 21:23:17 +0000 Subject: [PATCH 2/2] Add NULL check for tree_sitter_vb_dotnet() return value --- .../python/tree_sitter_tree_sitter_vb_dotnet/binding.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c b/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c index 08e4018..3bf1829 100644 --- a/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c +++ b/bindings/python/tree_sitter_tree_sitter_vb_dotnet/binding.c @@ -5,7 +5,12 @@ typedef struct TSLanguage TSLanguage; TSLanguage *tree_sitter_vb_dotnet(void); static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { - return PyCapsule_New(tree_sitter_vb_dotnet(), "tree_sitter.Language", NULL); + TSLanguage *language = tree_sitter_vb_dotnet(); + if (language == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Failed to load VB.NET language grammar"); + return NULL; + } + return PyCapsule_New(language, "tree_sitter.Language", NULL); } static struct PyModuleDef_Slot slots[] = {