From 3e74044602e864449e1c802d982280cdaac5c6e2 Mon Sep 17 00:00:00 2001
From: ttytm <tobmoj@web.de>
Date: Wed, 20 Mar 2024 23:06:34 +0100
Subject: [PATCH] keep bindings.h, add `--no-bindings` flag to tree-sitter
 generate

---
 tree_sitter_v/.gitattributes                          |  3 ---
 tree_sitter_v/bindings.v                              |  2 +-
 tree_sitter_v/bindings/c/tree-sitter-v.pc.in          | 11 -----------
 .../bindings/{c/tree-sitter-v.h => v/bindings.h}      |  0
 tree_sitter_v/bindings/v/tree-sitter-v.h              |  1 -
 tree_sitter_v/package.json                            |  2 +-
 6 files changed, 2 insertions(+), 17 deletions(-)
 delete mode 100644 tree_sitter_v/bindings/c/tree-sitter-v.pc.in
 rename tree_sitter_v/bindings/{c/tree-sitter-v.h => v/bindings.h} (100%)
 delete mode 120000 tree_sitter_v/bindings/v/tree-sitter-v.h

diff --git a/tree_sitter_v/.gitattributes b/tree_sitter_v/.gitattributes
index 777fcac4..c5f672fe 100644
--- a/tree_sitter_v/.gitattributes
+++ b/tree_sitter_v/.gitattributes
@@ -1,7 +1,4 @@
 grammar.js symlink=file
-bindings/v/tree-sitter-v.h symlink=file
-
-bindings/c/* linguist-generated
 
 src/tree_sitter/* linguist-generated
 src/grammar.json linguist-generated
diff --git a/tree_sitter_v/bindings.v b/tree_sitter_v/bindings.v
index a67ea25a..874768ac 100644
--- a/tree_sitter_v/bindings.v
+++ b/tree_sitter_v/bindings.v
@@ -8,7 +8,7 @@ import v_tree_sitter.tree_sitter
 #flag -I @VMODROOT/src
 #flag @VMODROOT/src/parser.c
 
-#include "tree-sitter-v.h"
+#include "bindings.h"
 
 fn C.tree_sitter_v() &tree_sitter.TSLanguage
 
diff --git a/tree_sitter_v/bindings/c/tree-sitter-v.pc.in b/tree_sitter_v/bindings/c/tree-sitter-v.pc.in
deleted file mode 100644
index 44795be9..00000000
--- a/tree_sitter_v/bindings/c/tree-sitter-v.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: tree-sitter-v
-Description: V grammar for tree-sitter
-URL: @URL@
-Version: @VERSION@
-Requires: @REQUIRES@
-Libs: -L${libdir} @ADDITIONAL_LIBS@ -ltree-sitter-v
-Cflags: -I${includedir}
diff --git a/tree_sitter_v/bindings/c/tree-sitter-v.h b/tree_sitter_v/bindings/v/bindings.h
similarity index 100%
rename from tree_sitter_v/bindings/c/tree-sitter-v.h
rename to tree_sitter_v/bindings/v/bindings.h
diff --git a/tree_sitter_v/bindings/v/tree-sitter-v.h b/tree_sitter_v/bindings/v/tree-sitter-v.h
deleted file mode 120000
index 337a0798..00000000
--- a/tree_sitter_v/bindings/v/tree-sitter-v.h
+++ /dev/null
@@ -1 +0,0 @@
-../c/tree-sitter-v.h
\ No newline at end of file
diff --git a/tree_sitter_v/package.json b/tree_sitter_v/package.json
index 0addc641..5871ea80 100644
--- a/tree_sitter_v/package.json
+++ b/tree_sitter_v/package.json
@@ -10,7 +10,7 @@
   },
   "scripts": {
     "test": "tree-sitter test",
-    "generate": "tree-sitter generate && v run generate_types.vsh",
+    "generate": "tree-sitter generate --no-bindings && v run generate_types.vsh",
     "parse": "tree-sitter parse",
     "parseg": "tree-sitter parse --debug-graph",
     "install": "node-gyp-build",