From 2ac2fae0fd8b88ef561518267db7436201c965d3 Mon Sep 17 00:00:00 2001 From: Nate Buttke Date: Sat, 12 Aug 2023 18:31:23 -0700 Subject: setup submodules and tree-sitter object creation for many languages --- .gitmodules | 21 +++++++++++++++++++++ tree-sitter-bash | 1 + tree-sitter-c | 1 + tree-sitter-cpp | 1 + tree-sitter-go | 1 + tree-sitter-haskell | 1 + tree-sitter-javascript | 1 + tree-sitter-ocaml | 1 + tree-sitter-python | 1 + tree-sitter-typescript | 1 + ts_create_object.py | 17 +++++++++++++++++ 11 files changed, 47 insertions(+) create mode 100644 .gitmodules create mode 160000 tree-sitter-bash create mode 160000 tree-sitter-c create mode 160000 tree-sitter-cpp create mode 160000 tree-sitter-go create mode 160000 tree-sitter-haskell create mode 160000 tree-sitter-javascript create mode 160000 tree-sitter-ocaml create mode 160000 tree-sitter-python create mode 160000 tree-sitter-typescript create mode 100644 ts_create_object.py diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4246223 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,21 @@ +[submodule "tree-sitter-javascript"] + path = tree-sitter-javascript + url = https://github.com/tree-sitter/tree-sitter-javascript +[submodule "tree-sitter-python"] + path = tree-sitter-python + url = https://github.com/tree-sitter/tree-sitter-python +[submodule "tree-sitter-go"] + path = tree-sitter-go + url = https://github.com/tree-sitter/tree-sitter-go +[submodule "tree-sitter-c"] + path = tree-sitter-c + url = https://github.com/tree-sitter/tree-sitter-c +[submodule "tree-sitter-cpp"] + path = tree-sitter-cpp + url = https://github.com/tree-sitter/tree-sitter-cpp +[submodule "tree-sitter-bash"] + path = tree-sitter-bash + url = https://github.com/tree-sitter/tree-sitter-bash +[submodule "tree-sitter-haskell"] + path = tree-sitter-haskell + url = https://github.com/tree-sitter/tree-sitter-haskell diff --git a/tree-sitter-bash b/tree-sitter-bash new file mode 160000 index 0000000..8077be4 --- /dev/null +++ b/tree-sitter-bash @@ -0,0 +1 @@ +Subproject commit 8077be4c5504f2618f1280295bc4ae20a75988c1 diff --git a/tree-sitter-c b/tree-sitter-c new file mode 160000 index 0000000..b62e08e --- /dev/null +++ b/tree-sitter-c @@ -0,0 +1 @@ +Subproject commit b62e08e5f91077a7d3604b605293c18c8493a721 diff --git a/tree-sitter-cpp b/tree-sitter-cpp new file mode 160000 index 0000000..77cecd8 --- /dev/null +++ b/tree-sitter-cpp @@ -0,0 +1 @@ +Subproject commit 77cecd88d28032bf4f54fd4ee68efb53a6c8c9a5 diff --git a/tree-sitter-go b/tree-sitter-go new file mode 160000 index 0000000..bbaa67a --- /dev/null +++ b/tree-sitter-go @@ -0,0 +1 @@ +Subproject commit bbaa67a180cfe0c943e50c55130918be8efb20bd diff --git a/tree-sitter-haskell b/tree-sitter-haskell new file mode 160000 index 0000000..9970682 --- /dev/null +++ b/tree-sitter-haskell @@ -0,0 +1 @@ +Subproject commit 99706824b92f162d4e0f47c7e930bbccb367276e diff --git a/tree-sitter-javascript b/tree-sitter-javascript new file mode 160000 index 0000000..f772967 --- /dev/null +++ b/tree-sitter-javascript @@ -0,0 +1 @@ +Subproject commit f772967f7b7bc7c28f845be2420a38472b16a8ee diff --git a/tree-sitter-ocaml b/tree-sitter-ocaml new file mode 160000 index 0000000..694c577 --- /dev/null +++ b/tree-sitter-ocaml @@ -0,0 +1 @@ +Subproject commit 694c57718fd85d514f8b81176038e7a4cfabcaaf diff --git a/tree-sitter-python b/tree-sitter-python new file mode 160000 index 0000000..5af00f6 --- /dev/null +++ b/tree-sitter-python @@ -0,0 +1 @@ +Subproject commit 5af00f64af6bbf822f208243cce5cf75396fb6f5 diff --git a/tree-sitter-typescript b/tree-sitter-typescript new file mode 160000 index 0000000..b1bf482 --- /dev/null +++ b/tree-sitter-typescript @@ -0,0 +1 @@ +Subproject commit b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf diff --git a/ts_create_object.py b/ts_create_object.py new file mode 100644 index 0000000..2cf3734 --- /dev/null +++ b/ts_create_object.py @@ -0,0 +1,17 @@ +from tree_sitter import Language, Parser + +Language.build_library( + # Store the library in the `build` directory + 'ts-languages.so', + + # Include one or more languages + [ + 'tree-sitter-javascript', + 'tree-sitter-python', + 'tree-sitter-go', + 'tree-sitter-c', + 'tree-sitter-cpp', + 'tree-sitter-bash', + 'tree-sitter-haskell' + ] +) -- cgit v1.2.3