From 1ab4d9b80355b075500423580015dddb39fdb0f9 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sat, 28 Oct 2023 07:56:04 +0100 Subject: [PATCH] Add tree-sitter grammars (#1) * fix: correct link to build-tree-sitter repo, add sudo * fix: checkout submodules * fixup! fix: checkout submodules * update submodules * fix: windows PATH * fix: sort git modules * fix: ignore target dir * fix: bring build-tree-sitter in-tree * fix: remove tree-sitter-hcl * fix: add new tree-sitter-hcl * fix: add new tree-sitter-hcl * fix: ocaml/markdown * fix: building * fix: building * fix: building * fix: building * fix: building * fix: building * fix: building * Create dependabot.yml * update modules * fix building * rename * update workflow * fix stupid source hut shit * use clang for ubuntu --- .github/dependabot.yml | 11 + .github/workflows/release.yaml | 59 +++++ .gitignore | 10 + .gitmodules | 150 ++++++++++++ build-tree-sitter/Cargo.lock | 414 ++++++++++++++++++++++++++++++++ build-tree-sitter/Cargo.toml | 17 ++ build-tree-sitter/build.rs | 6 + build-tree-sitter/src/main.rs | 278 +++++++++++++++++++++ config.toml | 172 +++++++++++++ grammars/tree-sitter-bash | 1 + grammars/tree-sitter-c | 1 + grammars/tree-sitter-c-sharp | 1 + grammars/tree-sitter-clojure | 1 + grammars/tree-sitter-cmake | 1 + grammars/tree-sitter-cpp | 1 + grammars/tree-sitter-css | 1 + grammars/tree-sitter-d | 1 + grammars/tree-sitter-dockerfile | 1 + grammars/tree-sitter-elixir | 1 + grammars/tree-sitter-elm | 1 + grammars/tree-sitter-erlang | 1 + grammars/tree-sitter-glimmer | 1 + grammars/tree-sitter-glsl | 1 + grammars/tree-sitter-go | 1 + grammars/tree-sitter-hare | 1 + grammars/tree-sitter-haskell | 1 + grammars/tree-sitter-haxe | 1 + grammars/tree-sitter-hcl | 1 + grammars/tree-sitter-html | 1 + grammars/tree-sitter-java | 1 + grammars/tree-sitter-javascript | 1 + grammars/tree-sitter-json | 1 + grammars/tree-sitter-julia | 1 + grammars/tree-sitter-kotlin | 1 + grammars/tree-sitter-latex | 1 + grammars/tree-sitter-lua | 1 + grammars/tree-sitter-markdown | 1 + grammars/tree-sitter-nix | 1 + grammars/tree-sitter-ocaml | 1 + grammars/tree-sitter-php | 1 + grammars/tree-sitter-prisma | 1 + grammars/tree-sitter-protobuf | 1 + grammars/tree-sitter-python | 1 + grammars/tree-sitter-ql | 1 + grammars/tree-sitter-r | 1 + grammars/tree-sitter-ruby | 1 + grammars/tree-sitter-rust | 1 + grammars/tree-sitter-scheme | 1 + grammars/tree-sitter-scss | 1 + grammars/tree-sitter-sql | 1 + grammars/tree-sitter-svelte | 1 + grammars/tree-sitter-swift | 1 + grammars/tree-sitter-toml | 1 + grammars/tree-sitter-typescript | 1 + grammars/tree-sitter-vue | 1 + grammars/tree-sitter-wgsl | 1 + grammars/tree-sitter-xml | 1 + grammars/tree-sitter-yaml | 1 + grammars/tree-sitter-zig | 1 + 59 files changed, 1167 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/release.yaml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 build-tree-sitter/Cargo.lock create mode 100644 build-tree-sitter/Cargo.toml create mode 100644 build-tree-sitter/build.rs create mode 100644 build-tree-sitter/src/main.rs create mode 100644 config.toml create mode 160000 grammars/tree-sitter-bash create mode 160000 grammars/tree-sitter-c create mode 160000 grammars/tree-sitter-c-sharp create mode 160000 grammars/tree-sitter-clojure create mode 160000 grammars/tree-sitter-cmake create mode 160000 grammars/tree-sitter-cpp create mode 160000 grammars/tree-sitter-css create mode 160000 grammars/tree-sitter-d create mode 160000 grammars/tree-sitter-dockerfile create mode 160000 grammars/tree-sitter-elixir create mode 160000 grammars/tree-sitter-elm create mode 160000 grammars/tree-sitter-erlang create mode 160000 grammars/tree-sitter-glimmer create mode 160000 grammars/tree-sitter-glsl create mode 160000 grammars/tree-sitter-go create mode 160000 grammars/tree-sitter-hare create mode 160000 grammars/tree-sitter-haskell create mode 160000 grammars/tree-sitter-haxe create mode 160000 grammars/tree-sitter-hcl create mode 160000 grammars/tree-sitter-html create mode 160000 grammars/tree-sitter-java create mode 160000 grammars/tree-sitter-javascript create mode 160000 grammars/tree-sitter-json create mode 160000 grammars/tree-sitter-julia create mode 160000 grammars/tree-sitter-kotlin create mode 160000 grammars/tree-sitter-latex create mode 160000 grammars/tree-sitter-lua create mode 160000 grammars/tree-sitter-markdown create mode 160000 grammars/tree-sitter-nix create mode 160000 grammars/tree-sitter-ocaml create mode 160000 grammars/tree-sitter-php create mode 160000 grammars/tree-sitter-prisma create mode 160000 grammars/tree-sitter-protobuf create mode 160000 grammars/tree-sitter-python create mode 160000 grammars/tree-sitter-ql create mode 160000 grammars/tree-sitter-r create mode 160000 grammars/tree-sitter-ruby create mode 160000 grammars/tree-sitter-rust create mode 160000 grammars/tree-sitter-scheme create mode 160000 grammars/tree-sitter-scss create mode 160000 grammars/tree-sitter-sql create mode 160000 grammars/tree-sitter-svelte create mode 160000 grammars/tree-sitter-swift create mode 160000 grammars/tree-sitter-toml create mode 160000 grammars/tree-sitter-typescript create mode 160000 grammars/tree-sitter-vue create mode 160000 grammars/tree-sitter-wgsl create mode 160000 grammars/tree-sitter-xml create mode 160000 grammars/tree-sitter-yaml create mode 160000 grammars/tree-sitter-zig diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1bd0449 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "rust" # See documentation for possible values + directory: "/build-tree-sitter" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..48a8c6b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,59 @@ +name: Release + +on: + schedule: + - cron: 0 0 */7 * * + workflow_dispatch: + inputs: + tag_name: + description: 'Tag name for release' + required: false + default: nightly + push: + tags: ["v[0-9]+.[0-9]+.[0-9]+*"] + pull_request: + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [windows, ubuntu, macos] + env: + RELEASE_TAG_NAME: ${{ inputs.tag_name }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install Ubuntu dependencies + if: matrix.os == 'ubuntu' + run: | + sudo apt-get -y update + sudo apt-get -y install curl wget clang pkg-config + sudo update-alternatives --set cc /usr/bin/clang + + - name: Update rust + run: rustup update + + - name: Fetch dependencies + run: | + cargo install --path ./build-tree-sitter --locked + cargo install tree-sitter-cli --locked + + - name: Build grammars + if: always() + run: | + build-tree-sitter --output ./output + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: lapce-${{ matrix.os }} + path: | + ./output + retention-days: 1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d25786 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +**.so +**.log +**.dll +**.dylib +**.exp +**.lib +**.obj + +/target +/output diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5026eb3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,150 @@ +[submodule "grammars/tree-sitter-bash"] + path = grammars/tree-sitter-bash + url = https://github.com/tree-sitter/tree-sitter-bash.git +[submodule "grammars/tree-sitter-c"] + path = grammars/tree-sitter-c + url = https://github.com/tree-sitter/tree-sitter-c.git +[submodule "grammars/tree-sitter-clojure"] + path = grammars/tree-sitter-clojure + url = https://github.com/abreumatheus/tree-sitter-clojure.git +[submodule "grammars/tree-sitter-cmake"] + path = grammars/tree-sitter-cmake + url = https://github.com/uyha/tree-sitter-cmake.git +[submodule "grammars/tree-sitter-cpp"] + path = grammars/tree-sitter-cpp + url = https://github.com/tree-sitter/tree-sitter-cpp.git +[submodule "grammars/tree-sitter-c-sharp"] + path = grammars/tree-sitter-c-sharp + url = https://github.com/tree-sitter/tree-sitter-c-sharp.git +[submodule "grammars/tree-sitter-css"] + path = grammars/tree-sitter-css + url = https://github.com/syntacti/tree-sitter-css.git +[submodule "grammars/tree-sitter-d"] + path = grammars/tree-sitter-d + url = https://github.com/ghishadow/tree-sitter-d.git +[submodule "grammars/tree-sitter-dockerfile"] + path = grammars/tree-sitter-dockerfile + url = https://github.com/panekj/tree-sitter-dockerfile.git +[submodule "grammars/tree-sitter-elixir"] + path = grammars/tree-sitter-elixir + url = https://github.com/elixir-lang/tree-sitter-elixir.git +[submodule "grammars/tree-sitter-elm"] + path = grammars/tree-sitter-elm + url = https://github.com/elm-tooling/tree-sitter-elm.git +[submodule "grammars/tree-sitter-erlang"] + path = grammars/tree-sitter-erlang + url = https://github.com/WhatsApp/tree-sitter-erlang.git +[submodule "grammars/tree-sitter-glimmer"] + path = grammars/tree-sitter-glimmer + url = https://github.com/VixieTSQ/tree-sitter-glimmer.git +[submodule "grammars/tree-sitter-glsl"] + path = grammars/tree-sitter-glsl + url = https://github.com/theHamsta/tree-sitter-glsl.git +[submodule "grammars/tree-sitter-go"] + path = grammars/tree-sitter-go + url = https://github.com/tree-sitter/tree-sitter-go.git +[submodule "grammars/tree-sitter-hare"] + path = grammars/tree-sitter-hare + url = https://git.sr.ht/~ghishadow/tree-sitter-hare +[submodule "grammars/tree-sitter-haskell"] + path = grammars/tree-sitter-haskell + url = https://github.com/tree-sitter/tree-sitter-haskell.git +[submodule "grammars/tree-sitter-haxe"] + path = grammars/tree-sitter-haxe + url = https://github.com/vantreeseba/tree-sitter-haxe.git +[submodule "grammars/tree-sitter-hcl"] + path = grammars/tree-sitter-hcl + url = https://github.com/MichaHoffmann/tree-sitter-hcl.git +[submodule "grammars/tree-sitter-html"] + path = grammars/tree-sitter-html + url = https://github.com/tree-sitter/tree-sitter-html.git +[submodule "grammars/tree-sitter-java"] + path = grammars/tree-sitter-java + url = https://github.com/tree-sitter/tree-sitter-java.git +[submodule "grammars/tree-sitter-javascript"] + path = grammars/tree-sitter-javascript + url = https://github.com/tree-sitter/tree-sitter-javascript.git +[submodule "grammars/tree-sitter-json"] + path = grammars/tree-sitter-json + url = https://github.com/tree-sitter/tree-sitter-json.git +[submodule "grammars/tree-sitter-julia"] + path = grammars/tree-sitter-julia + url = https://github.com/varlad/tree-sitter-julia.git +[submodule "grammars/tree-sitter-kotlin"] + path = grammars/tree-sitter-kotlin + url = https://github.com/fwcd/tree-sitter-kotlin.git +[submodule "grammars/tree-sitter-latex"] + path = grammars/tree-sitter-latex + url = https://github.com/latex-lsp/tree-sitter-latex.git +[submodule "grammars/tree-sitter-lua"] + path = grammars/tree-sitter-lua + url = https://github.com/syntacti/tree-sitter-lua.git +[submodule "grammars/tree-sitter-markdown"] + path = grammars/tree-sitter-markdown + url = https://github.com/MDeiml/tree-sitter-markdown.git +[submodule "grammars/tree-sitter-nix"] + path = grammars/tree-sitter-nix + url = https://github.com/panekj/tree-sitter-nix.git +[submodule "grammars/tree-sitter-ocaml"] + path = grammars/tree-sitter-ocaml + url = https://github.com/tree-sitter/tree-sitter-ocaml.git +[submodule "grammars/tree-sitter-php"] + path = grammars/tree-sitter-php + url = https://github.com/tree-sitter/tree-sitter-php.git +[submodule "grammars/tree-sitter-prisma"] + path = grammars/tree-sitter-prisma + url = https://github.com/victorhqc/tree-sitter-prisma.git +[submodule "grammars/tree-sitter-protobuf"] + path = grammars/tree-sitter-protobuf + url = https://github.com/yusdacra/tree-sitter-protobuf.git +[submodule "grammars/tree-sitter-python"] + path = grammars/tree-sitter-python + url = https://github.com/tree-sitter/tree-sitter-python.git +[submodule "grammars/tree-sitter-ql"] + path = grammars/tree-sitter-ql + url = https://github.com/tree-sitter/tree-sitter-ql.git +[submodule "grammars/tree-sitter-r"] + path = grammars/tree-sitter-r + url = https://github.com/r-lib/tree-sitter-r.git +[submodule "grammars/tree-sitter-ruby"] + path = grammars/tree-sitter-ruby + url = https://github.com/tree-sitter/tree-sitter-ruby.git +[submodule "grammars/tree-sitter-rust"] + path = grammars/tree-sitter-rust + url = https://github.com/tree-sitter/tree-sitter-rust.git +[submodule "grammars/tree-sitter-scheme"] + path = grammars/tree-sitter-scheme + url = https://github.com/6cdh/tree-sitter-scheme.git +[submodule "grammars/tree-sitter-scss"] + path = grammars/tree-sitter-scss + url = https://github.com/VixieTSQ/tree-sitter-scss.git +[submodule "grammars/tree-sitter-sql"] + path = grammars/tree-sitter-sql + url = https://github.com/oknozor/tree-sitter-sql.git +[submodule "grammars/tree-sitter-svelte"] + path = grammars/tree-sitter-svelte + url = https://github.com/Himujjal/tree-sitter-svelte.git +[submodule "grammars/tree-sitter-swift"] + path = grammars/tree-sitter-swift + url = https://github.com/alex-pinkus/tree-sitter-swift.git +[submodule "grammars/tree-sitter-toml"] + path = grammars/tree-sitter-toml + url = https://github.com/Mathspy/tree-sitter-toml.git +[submodule "grammars/tree-sitter-typescript"] + path = grammars/tree-sitter-typescript + url = https://github.com/tree-sitter/tree-sitter-typescript.git +[submodule "grammars/tree-sitter-vue"] + path = grammars/tree-sitter-vue + url = https://github.com/xiaoxin-sky/tree-sitter-vue.git +[submodule "grammars/tree-sitter-wgsl"] + path = grammars/tree-sitter-wgsl + url = https://github.com/szebniok/tree-sitter-wgsl.git +[submodule "grammars/tree-sitter-xml"] + path = grammars/tree-sitter-xml + url = https://github.com/RenjiSann/tree-sitter-xml.git +[submodule "grammars/tree-sitter-yaml"] + path = grammars/tree-sitter-yaml + url = https://github.com/panekj/tree-sitter-yaml.git +[submodule "grammars/tree-sitter-zig"] + path = grammars/tree-sitter-zig + url = https://github.com/maxxnino/tree-sitter-zig.git diff --git a/build-tree-sitter/Cargo.lock b/build-tree-sitter/Cargo.lock new file mode 100644 index 0000000..82c55d8 --- /dev/null +++ b/build-tree-sitter/Cargo.lock @@ -0,0 +1,414 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "build-tree-sitter" +version = "0.1.0" +dependencies = [ + "anyhow", + "cc", + "clap", + "dunce", + "serde", + "toml", + "tracing", + "tracing-subscriber", + "walkdir", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "serde" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] diff --git a/build-tree-sitter/Cargo.toml b/build-tree-sitter/Cargo.toml new file mode 100644 index 0000000..f634ad6 --- /dev/null +++ b/build-tree-sitter/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "build-tree-sitter" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +cc = "1.0" +anyhow = "1.0" +tracing = "0.1.37" +tracing-subscriber = "0.3.17" +clap = { version = "4.3.23", features = ["derive", "std", "help"], default-features = false } +walkdir = "2.3.3" +toml = "0.8.2" +serde = { version = "1.0.188", features = ["derive"] } +dunce = "1.0.4" diff --git a/build-tree-sitter/build.rs b/build-tree-sitter/build.rs new file mode 100644 index 0000000..e0ebd1c --- /dev/null +++ b/build-tree-sitter/build.rs @@ -0,0 +1,6 @@ +fn main() { + println!( + "cargo:rustc-env=BUILD_TARGET={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/build-tree-sitter/src/main.rs b/build-tree-sitter/src/main.rs new file mode 100644 index 0000000..7483633 --- /dev/null +++ b/build-tree-sitter/src/main.rs @@ -0,0 +1,278 @@ +use anyhow::{bail, Context, Result}; +use clap::Parser; +use dunce::canonicalize; +use serde::{Deserialize, Serialize}; +use std::{ + fs::{self}, + path::{Path, PathBuf}, + process::Command, + time::SystemTime, +}; +use tracing::{debug, error, info, Level}; +use tracing_subscriber::FmtSubscriber; + +const BUILD_TARGET: &str = env!("BUILD_TARGET"); + +#[derive(Parser)] +struct Cli { + dir: Option, + #[clap(short, long)] + output: PathBuf, +} + +#[non_exhaustive] +#[derive(Debug, Deserialize, Serialize)] +struct GrammarsFile { + grammars: std::collections::HashMap, +} + +#[non_exhaustive] +#[derive(Debug, Deserialize, Serialize)] +struct GrammarBuildInfo { + path: PathBuf, + cpp: Option, + relative: Option, + generate: Option, +} + +fn logging() -> Result<()> { + let subscriber = FmtSubscriber::builder() + .with_max_level(Level::DEBUG) + .finish(); + tracing::subscriber::set_global_default(subscriber)?; + Ok(()) +} + +const GRAMMARS_CONFIG: &str = "config.toml"; + +fn main() -> Result<()> { + logging()?; + + let cli = Cli::parse(); + + if !cli.output.exists() { + if let Err(e) = std::fs::create_dir_all(&cli.output) { + error!("Failed to create output dir: {}", e); + bail!(e); + }; + } + let output_dir = match canonicalize(&cli.output) { + Ok(v) => v, + Err(e) => { + bail!("Failed to canonicalize '{}': {e}", &cli.output.display()); + } + }; + + let Ok(grammars_config) = canonicalize(PathBuf::from(GRAMMARS_CONFIG)) else { + error!("Failed to canonicalize grammars config"); + bail!("Failed to canonicalize grammars config"); + }; + let Ok(grammars) = &fs::read_to_string(grammars_config) else { + error!("Failed to read grammars config"); + bail!("Failed to read grammars config"); + }; + let Ok(config) = toml::from_str::(grammars) else { + error!("Failed to deserialize config"); + bail!("Failed to deserialize config"); + }; + + for (name, grammar) in config.grammars { + info!("Building: {name}"); + let grammar_path = match canonicalize(&grammar.path) { + Ok(v) => v, + Err(e) => { + error!("Failed to canonicalize '{}': {e}", grammar.path.display()); + continue; + } + }; + let paths = TreeSitterPaths::new( + grammar_path, + grammar.relative, + grammar.cpp, + grammar.generate, + ); + match build_tree_sitter_library(&paths, &output_dir, &name) { + Ok(_) => {} + Err(e) => { + error!("Failed to build grammar: {e}"); + continue; + } + }; + } + + Ok(()) +} + +fn build_tree_sitter_library(paths: &TreeSitterPaths, output: &Path, name: &str) -> Result { + let mut library_path = output.join(name); + library_path.set_extension(std::env::consts::DLL_EXTENSION); + info!("Build object: {}", library_path.display()); + + let should_recompile = paths.should_recompile(&library_path)?; + + if !should_recompile { + return Ok(false); + } + + let cpp = if let Some(TreeSitterScannerSource { path: _, cpp }) = paths.scanner { + cpp + } else { + false + }; + + let mut compiler = cc::Build::new(); + compiler + .cpp(cpp) + .warnings(false) + .include(&paths.source) + .opt_level(3) + .cargo_metadata(false) + .shared_flag(true) + .host(BUILD_TARGET) + .target(BUILD_TARGET); + + let mut command = compiler.try_get_compiler()?.to_command(); + command.arg(&paths.parser); + if cfg!(windows) { + if let Some(TreeSitterScannerSource { ref path, .. }) = paths.scanner { + command.arg(path); + } + command.arg("/link"); + command.arg("/DLL"); + command.arg(format!("/out:{}", library_path.to_str().unwrap())); + } else { + // command.arg(&paths.parser); + command + .arg("-fPIC") + .arg("-fno-exceptions") + .arg("-g") + .arg("-o") + .arg(&library_path); + if let Some(TreeSitterScannerSource { ref path, cpp }) = paths.scanner { + if cpp { + command.arg("-xc++"); + } else { + command.arg("-xc").arg("-std=c99"); + } + command.arg(path); + } + } + + // Compile the tree sitter library + let command_str = format!("{command:?}"); + debug!("Running {command_str}"); + let output = command + .output() + .with_context(|| format!("Failed to run C compiler. Command: {command_str}"))?; + if !output.status.success() { + bail!( + "Parser compilation failed:\nCommand: {command_str}\nStdout: {}\nStderr: {}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + ); + } + + Ok(true) +} + +struct TreeSitterScannerSource { + path: PathBuf, + cpp: bool, +} + +struct TreeSitterPaths { + source: PathBuf, + parser: PathBuf, + scanner: Option, +} + +impl TreeSitterPaths { + fn new( + repo: PathBuf, + relative: Option, + cpp: Option, + generate: Option, + ) -> Self { + let _cpp = if let Some(cpp) = cpp { cpp } else { false }; + // Resolve subpath within the repo if any + let subpath = relative.map(|subpath| repo.join(subpath)).unwrap_or(repo); + + if let Some(generate) = generate { + if generate { + match Command::new("tree-sitter") + .args(["generate", "--abi", "latest", "grammar.js"]) + .current_dir(subpath.clone()) + .status() + { + Ok(_) => {} + Err(e) => { + error!("Failed to generate parser: {e}"); + } + }; + } + } + + // Source directory + let source = subpath.join("src"); + + // Path to parser source + let parser = source.join("parser.c"); + + // Path to scanner if any + let mut scanner_path = source.join("scanner.c"); + let scanner = if scanner_path.exists() { + Some(TreeSitterScannerSource { + path: scanner_path, + cpp: false, + }) + } else { + scanner_path.set_extension("cc"); + if scanner_path.exists() { + Some(TreeSitterScannerSource { + path: scanner_path, + cpp: true, + }) + } else { + None + } + }; + + Self { + source, + parser, + scanner, + } + } + + fn should_recompile(&self, library_path: &Path) -> Result { + if !library_path.exists() { + return Ok(true); + }; + + let library_mtime = mtime(library_path)?; + if mtime(&self.parser)? > library_mtime { + return Ok(true); + } + + if let Some(TreeSitterScannerSource { ref path, .. }) = self.scanner { + if mtime(path)? > library_mtime { + return Ok(true); + } + } + Ok(false) + } +} + +fn mtime(path: &Path) -> Result { + let meta = match std::fs::metadata(path) { + Ok(v) => v, + Err(e) => bail!("Failed to get metadata: {e}"), + }; + + let modified = match meta.modified() { + Ok(v) => v, + Err(e) => bail!("Failed to get modified time: {e}"), + }; + + Ok(modified) +} diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..76c725c --- /dev/null +++ b/config.toml @@ -0,0 +1,172 @@ +[grammars] + +# [grammars.tree-sitter-name] +# path = "./grammars/tree-sitter-name" +# cpp = true +# relative = "subpath" + +[grammars.tree-sitter-bash] +path = "./grammars/tree-sitter-bash" + +[grammars.tree-sitter-c] +path = "./grammars/tree-sitter-c" + +[grammars.tree-sitter-c-sharp] +path = "./grammars/tree-sitter-c-sharp" + +[grammars.tree-sitter-clojure] +path = "./grammars/tree-sitter-clojure" + +[grammars.tree-sitter-cmake] +path = "./grammars/tree-sitter-cmake" + +[grammars.tree-sitter-cpp] +path = "./grammars/tree-sitter-cpp" + +[grammars.tree-sitter-css] +path = "./grammars/tree-sitter-css" + +[grammars.tree-sitter-d] +path = "./grammars/tree-sitter-d" + +[grammars.tree-sitter-dockerfile] +path = "./grammars/tree-sitter-dockerfile" + +[grammars.tree-sitter-elixir] +path = "./grammars/tree-sitter-elixir" + +[grammars.tree-sitter-elm] +path = "./grammars/tree-sitter-elm" + +[grammars.tree-sitter-erlang] +path = "./grammars/tree-sitter-erlang" + +[grammars.tree-sitter-glimmer] +path = "./grammars/tree-sitter-glimmer" + +[grammars.tree-sitter-glsl] +path = "./grammars/tree-sitter-glsl" + +[grammars.tree-sitter-go] +path = "./grammars/tree-sitter-go" + +[grammars.tree-sitter-hare] +path = "./grammars/tree-sitter-hare" + +[grammars.tree-sitter-haskell] +path = "./grammars/tree-sitter-haskell" + +[grammars.tree-sitter-haxe] +path = "./grammars/tree-sitter-haxe" + +[grammars.tree-sitter-hcl] +path = "./grammars/tree-sitter-hcl" + +[grammars.tree-sitter-html] +path = "./grammars/tree-sitter-html" + +[grammars.tree-sitter-java] +path = "./grammars/tree-sitter-java" + +[grammars.tree-sitter-javascript] +path = "./grammars/tree-sitter-javascript" + +[grammars.tree-sitter-json] +path = "./grammars/tree-sitter-json" + +[grammars.tree-sitter-julia] +path = "./grammars/tree-sitter-julia" + +[grammars.tree-sitter-kotlin] +path = "./grammars/tree-sitter-kotlin" + +[grammars.tree-sitter-latex] +path = "./grammars/tree-sitter-latex" + +[grammars.tree-sitter-lua] +path = "./grammars/tree-sitter-lua" + +[grammars.tree-sitter-markdown] +path = "./grammars/tree-sitter-markdown" +relative = "tree-sitter-markdown" + +[grammars.tree-sitter-markdown-inline] +path = "./grammars/tree-sitter-markdown" +relative = "tree-sitter-markdown-inline" + +[grammars.tree-sitter-nix] +path = "./grammars/tree-sitter-nix" + +[grammars.tree-sitter-ocaml] +path = "./grammars/tree-sitter-ocaml" +relative = "ocaml" + +[grammars.tree-sitter-ocaml-interface] +path = "./grammars/tree-sitter-ocaml" +relative = "interface" + +[grammars.tree-sitter-php] +path = "./grammars/tree-sitter-php" + +[grammars.tree-sitter-prisma] +path = "./grammars/tree-sitter-prisma" + +[grammars.tree-sitter-protobuf] +path = "./grammars/tree-sitter-protobuf" + +[grammars.tree-sitter-python] +path = "./grammars/tree-sitter-python" + +[grammars.tree-sitter-ql] +path = "./grammars/tree-sitter-ql" + +[grammars.tree-sitter-r] +path = "./grammars/tree-sitter-r" + +[grammars.tree-sitter-ruby] +path = "./grammars/tree-sitter-ruby" + +[grammars.tree-sitter-rust] +path = "./grammars/tree-sitter-rust" + +[grammars.tree-sitter-scheme] +path = "./grammars/tree-sitter-scheme" + +[grammars.tree-sitter-scss] +path = "./grammars/tree-sitter-scss" + +[grammars.tree-sitter-sql] +path = "./grammars/tree-sitter-sql" + +[grammars.tree-sitter-svelte] +path = "./grammars/tree-sitter-svelte" + +[grammars.tree-sitter-swift] +generate = true +path = "./grammars/tree-sitter-swift" + +[grammars.tree-sitter-toml] +path = "./grammars/tree-sitter-toml" + +[grammars.tree-sitter-typescript] +path = "./grammars/tree-sitter-typescript" +relative = "typescript" + +[grammars.tree-sitter-typescript-react] +path = "./grammars/tree-sitter-typescript" +relative = "tsx" + +[grammars.tree-sitter-vue] +path = "./grammars/tree-sitter-vue" + +[grammars.tree-sitter-wgsl] +path = "./grammars/tree-sitter-wgsl" + +[grammars.tree-sitter-xml] +path = "./grammars/tree-sitter-xml" + +[grammars.tree-sitter-yaml] +path = "./grammars/tree-sitter-yaml" + +[grammars.tree-sitter-zig] +path = "./grammars/tree-sitter-zig" diff --git a/grammars/tree-sitter-bash b/grammars/tree-sitter-bash new file mode 160000 index 0000000..c0f5797 --- /dev/null +++ b/grammars/tree-sitter-bash @@ -0,0 +1 @@ +Subproject commit c0f5797a728fc4ebd78a8b0e436b1494a8ab5f51 diff --git a/grammars/tree-sitter-c b/grammars/tree-sitter-c new file mode 160000 index 0000000..a2b7bac --- /dev/null +++ b/grammars/tree-sitter-c @@ -0,0 +1 @@ +Subproject commit a2b7bac3b313efbaa683d9a276ff63cdc544d960 diff --git a/grammars/tree-sitter-c-sharp b/grammars/tree-sitter-c-sharp new file mode 160000 index 0000000..1648e21 --- /dev/null +++ b/grammars/tree-sitter-c-sharp @@ -0,0 +1 @@ +Subproject commit 1648e21b4f087963abf0101ee5221bb413107b07 diff --git a/grammars/tree-sitter-clojure b/grammars/tree-sitter-clojure new file mode 160000 index 0000000..fdc969e --- /dev/null +++ b/grammars/tree-sitter-clojure @@ -0,0 +1 @@ +Subproject commit fdc969eb04fc711e38ad74afe441d74b3b5d3091 diff --git a/grammars/tree-sitter-cmake b/grammars/tree-sitter-cmake new file mode 160000 index 0000000..73ab4b8 --- /dev/null +++ b/grammars/tree-sitter-cmake @@ -0,0 +1 @@ +Subproject commit 73ab4b8e9522f014a67f87f585e820d36fa47408 diff --git a/grammars/tree-sitter-cpp b/grammars/tree-sitter-cpp new file mode 160000 index 0000000..a90f170 --- /dev/null +++ b/grammars/tree-sitter-cpp @@ -0,0 +1 @@ +Subproject commit a90f170f92d5d70e7c2d4183c146e61ba5f3a457 diff --git a/grammars/tree-sitter-css b/grammars/tree-sitter-css new file mode 160000 index 0000000..397aa13 --- /dev/null +++ b/grammars/tree-sitter-css @@ -0,0 +1 @@ +Subproject commit 397aa132b9982fcdd2d473ed69343762a557f10a diff --git a/grammars/tree-sitter-d b/grammars/tree-sitter-d new file mode 160000 index 0000000..d129542 --- /dev/null +++ b/grammars/tree-sitter-d @@ -0,0 +1 @@ +Subproject commit d12954211a2f88a975dce21587617d7e6716b70f diff --git a/grammars/tree-sitter-dockerfile b/grammars/tree-sitter-dockerfile new file mode 160000 index 0000000..25c71d6 --- /dev/null +++ b/grammars/tree-sitter-dockerfile @@ -0,0 +1 @@ +Subproject commit 25c71d6a24cdba8f0c74ef40d4d2d93defd7e196 diff --git a/grammars/tree-sitter-elixir b/grammars/tree-sitter-elixir new file mode 160000 index 0000000..a2861e8 --- /dev/null +++ b/grammars/tree-sitter-elixir @@ -0,0 +1 @@ +Subproject commit a2861e88a730287a60c11ea9299c033c7d076e30 diff --git a/grammars/tree-sitter-elm b/grammars/tree-sitter-elm new file mode 160000 index 0000000..b075803 --- /dev/null +++ b/grammars/tree-sitter-elm @@ -0,0 +1 @@ +Subproject commit b075803c445191af3cf7dbfdc84efef5f5bbc0f5 diff --git a/grammars/tree-sitter-erlang b/grammars/tree-sitter-erlang new file mode 160000 index 0000000..7aa24fe --- /dev/null +++ b/grammars/tree-sitter-erlang @@ -0,0 +1 @@ +Subproject commit 7aa24fe8616072fc1a659f72d5b60bd8c01fb5cc diff --git a/grammars/tree-sitter-glimmer b/grammars/tree-sitter-glimmer new file mode 160000 index 0000000..7281cac --- /dev/null +++ b/grammars/tree-sitter-glimmer @@ -0,0 +1 @@ +Subproject commit 7281caca2ba114e1960c5d944a37860ef0841426 diff --git a/grammars/tree-sitter-glsl b/grammars/tree-sitter-glsl new file mode 160000 index 0000000..4780c2b --- /dev/null +++ b/grammars/tree-sitter-glsl @@ -0,0 +1 @@ +Subproject commit 4780c2b689a5a5bd0ccfd78403510e9cf4a0f2fc diff --git a/grammars/tree-sitter-go b/grammars/tree-sitter-go new file mode 160000 index 0000000..bbaa67a --- /dev/null +++ b/grammars/tree-sitter-go @@ -0,0 +1 @@ +Subproject commit bbaa67a180cfe0c943e50c55130918be8efb20bd diff --git a/grammars/tree-sitter-hare b/grammars/tree-sitter-hare new file mode 160000 index 0000000..7d9080c --- /dev/null +++ b/grammars/tree-sitter-hare @@ -0,0 +1 @@ +Subproject commit 7d9080c73eacb7b22900a71320058025615d57fa diff --git a/grammars/tree-sitter-haskell b/grammars/tree-sitter-haskell new file mode 160000 index 0000000..9970682 --- /dev/null +++ b/grammars/tree-sitter-haskell @@ -0,0 +1 @@ +Subproject commit 99706824b92f162d4e0f47c7e930bbccb367276e diff --git a/grammars/tree-sitter-haxe b/grammars/tree-sitter-haxe new file mode 160000 index 0000000..b150fdb --- /dev/null +++ b/grammars/tree-sitter-haxe @@ -0,0 +1 @@ +Subproject commit b150fdb311e2a24d3e0cba37ae4954427f5d0cf9 diff --git a/grammars/tree-sitter-hcl b/grammars/tree-sitter-hcl new file mode 160000 index 0000000..b553906 --- /dev/null +++ b/grammars/tree-sitter-hcl @@ -0,0 +1 @@ +Subproject commit b5539065432c08e4118eb3ee7c94902fdda85708 diff --git a/grammars/tree-sitter-html b/grammars/tree-sitter-html new file mode 160000 index 0000000..e5d7d7d --- /dev/null +++ b/grammars/tree-sitter-html @@ -0,0 +1 @@ +Subproject commit e5d7d7decbbdec5a4c90bbc69436b3828f5646e7 diff --git a/grammars/tree-sitter-java b/grammars/tree-sitter-java new file mode 160000 index 0000000..0b3f9cf --- /dev/null +++ b/grammars/tree-sitter-java @@ -0,0 +1 @@ +Subproject commit 0b3f9cfe10a973df0530533313fdbef6c2c92bfa diff --git a/grammars/tree-sitter-javascript b/grammars/tree-sitter-javascript new file mode 160000 index 0000000..c69aaba --- /dev/null +++ b/grammars/tree-sitter-javascript @@ -0,0 +1 @@ +Subproject commit c69aabab53609d00e8e198ab902e4fde4b8e449f diff --git a/grammars/tree-sitter-json b/grammars/tree-sitter-json new file mode 160000 index 0000000..ca3f891 --- /dev/null +++ b/grammars/tree-sitter-json @@ -0,0 +1 @@ +Subproject commit ca3f8919800e3c1ad4508de3bfd7b0b860ce434f diff --git a/grammars/tree-sitter-julia b/grammars/tree-sitter-julia new file mode 160000 index 0000000..09aba7f --- /dev/null +++ b/grammars/tree-sitter-julia @@ -0,0 +1 @@ +Subproject commit 09aba7f2e9149148cd42b9af17f52adbc9a5da90 diff --git a/grammars/tree-sitter-kotlin b/grammars/tree-sitter-kotlin new file mode 160000 index 0000000..06a2f6e --- /dev/null +++ b/grammars/tree-sitter-kotlin @@ -0,0 +1 @@ +Subproject commit 06a2f6e71c7fcac34addcbf2a4667adad1b9c5a7 diff --git a/grammars/tree-sitter-latex b/grammars/tree-sitter-latex new file mode 160000 index 0000000..2ae2021 --- /dev/null +++ b/grammars/tree-sitter-latex @@ -0,0 +1 @@ +Subproject commit 2ae2021d7b224fb6aa57b760e0d146059f943bb8 diff --git a/grammars/tree-sitter-lua b/grammars/tree-sitter-lua new file mode 160000 index 0000000..a29f646 --- /dev/null +++ b/grammars/tree-sitter-lua @@ -0,0 +1 @@ +Subproject commit a29f646c14ed800aaeef1ca58a9bacc6d92922e8 diff --git a/grammars/tree-sitter-markdown b/grammars/tree-sitter-markdown new file mode 160000 index 0000000..aaf7679 --- /dev/null +++ b/grammars/tree-sitter-markdown @@ -0,0 +1 @@ +Subproject commit aaf76797aa8ecd9a5e78e0ec3681941de6c945ee diff --git a/grammars/tree-sitter-nix b/grammars/tree-sitter-nix new file mode 160000 index 0000000..59fc471 --- /dev/null +++ b/grammars/tree-sitter-nix @@ -0,0 +1 @@ +Subproject commit 59fc47150ab437e8bb356c7ab21e9531e87f7cc8 diff --git a/grammars/tree-sitter-ocaml b/grammars/tree-sitter-ocaml new file mode 160000 index 0000000..694c577 --- /dev/null +++ b/grammars/tree-sitter-ocaml @@ -0,0 +1 @@ +Subproject commit 694c57718fd85d514f8b81176038e7a4cfabcaaf diff --git a/grammars/tree-sitter-php b/grammars/tree-sitter-php new file mode 160000 index 0000000..ce2c73a --- /dev/null +++ b/grammars/tree-sitter-php @@ -0,0 +1 @@ +Subproject commit ce2c73a8d84b5648e8792698dc9fd955e5f6a906 diff --git a/grammars/tree-sitter-prisma b/grammars/tree-sitter-prisma new file mode 160000 index 0000000..eca2596 --- /dev/null +++ b/grammars/tree-sitter-prisma @@ -0,0 +1 @@ +Subproject commit eca2596a355b1a9952b4f80f8f9caed300a272b5 diff --git a/grammars/tree-sitter-protobuf b/grammars/tree-sitter-protobuf new file mode 160000 index 0000000..5aef38d --- /dev/null +++ b/grammars/tree-sitter-protobuf @@ -0,0 +1 @@ +Subproject commit 5aef38d655f76a6b0d172340eed3766c93b3124c diff --git a/grammars/tree-sitter-python b/grammars/tree-sitter-python new file mode 160000 index 0000000..c01fb4e --- /dev/null +++ b/grammars/tree-sitter-python @@ -0,0 +1 @@ +Subproject commit c01fb4e38587e959b9058b8cd34b9e6a3068c827 diff --git a/grammars/tree-sitter-ql b/grammars/tree-sitter-ql new file mode 160000 index 0000000..bd08702 --- /dev/null +++ b/grammars/tree-sitter-ql @@ -0,0 +1 @@ +Subproject commit bd087020f0d8c183080ca615d38de0ec827aeeaf diff --git a/grammars/tree-sitter-r b/grammars/tree-sitter-r new file mode 160000 index 0000000..c55f8b4 --- /dev/null +++ b/grammars/tree-sitter-r @@ -0,0 +1 @@ +Subproject commit c55f8b4dfaa32c80ddef6c0ac0e79b05cb0cbf57 diff --git a/grammars/tree-sitter-ruby b/grammars/tree-sitter-ruby new file mode 160000 index 0000000..f257f3f --- /dev/null +++ b/grammars/tree-sitter-ruby @@ -0,0 +1 @@ +Subproject commit f257f3f57833d584050336921773738a3fd8ca22 diff --git a/grammars/tree-sitter-rust b/grammars/tree-sitter-rust new file mode 160000 index 0000000..0a70e15 --- /dev/null +++ b/grammars/tree-sitter-rust @@ -0,0 +1 @@ +Subproject commit 0a70e15da977489d954c219af9b50b8a722630ee diff --git a/grammars/tree-sitter-scheme b/grammars/tree-sitter-scheme new file mode 160000 index 0000000..af3af6c --- /dev/null +++ b/grammars/tree-sitter-scheme @@ -0,0 +1 @@ +Subproject commit af3af6c9356b936f8a515a1e449c32e804c2b1a8 diff --git a/grammars/tree-sitter-scss b/grammars/tree-sitter-scss new file mode 160000 index 0000000..c478c68 --- /dev/null +++ b/grammars/tree-sitter-scss @@ -0,0 +1 @@ +Subproject commit c478c6868648eff49eb04a4df90d703dc45b312a diff --git a/grammars/tree-sitter-sql b/grammars/tree-sitter-sql new file mode 160000 index 0000000..15dad0f --- /dev/null +++ b/grammars/tree-sitter-sql @@ -0,0 +1 @@ +Subproject commit 15dad0f3cae8a094a7dac17d712ea8fb25228011 diff --git a/grammars/tree-sitter-svelte b/grammars/tree-sitter-svelte new file mode 160000 index 0000000..697bb51 --- /dev/null +++ b/grammars/tree-sitter-svelte @@ -0,0 +1 @@ +Subproject commit 697bb515471871e85ff799ea57a76298a71a9cca diff --git a/grammars/tree-sitter-swift b/grammars/tree-sitter-swift new file mode 160000 index 0000000..29541ac --- /dev/null +++ b/grammars/tree-sitter-swift @@ -0,0 +1 @@ +Subproject commit 29541ac9bbe2090de75d0b1e70360b85bbda1fef diff --git a/grammars/tree-sitter-toml b/grammars/tree-sitter-toml new file mode 160000 index 0000000..ae4cdb5 --- /dev/null +++ b/grammars/tree-sitter-toml @@ -0,0 +1 @@ +Subproject commit ae4cdb5d27bf876a432b6c30b6a88f56c9b3e761 diff --git a/grammars/tree-sitter-typescript b/grammars/tree-sitter-typescript new file mode 160000 index 0000000..b1bf482 --- /dev/null +++ b/grammars/tree-sitter-typescript @@ -0,0 +1 @@ +Subproject commit b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf diff --git a/grammars/tree-sitter-vue b/grammars/tree-sitter-vue new file mode 160000 index 0000000..8bbcd4c --- /dev/null +++ b/grammars/tree-sitter-vue @@ -0,0 +1 @@ +Subproject commit 8bbcd4cbd59c03b895d226c272e3c835f4329eef diff --git a/grammars/tree-sitter-wgsl b/grammars/tree-sitter-wgsl new file mode 160000 index 0000000..40259f3 --- /dev/null +++ b/grammars/tree-sitter-wgsl @@ -0,0 +1 @@ +Subproject commit 40259f3c77ea856841a4e0c4c807705f3e4a2b65 diff --git a/grammars/tree-sitter-xml b/grammars/tree-sitter-xml new file mode 160000 index 0000000..48a7c2b --- /dev/null +++ b/grammars/tree-sitter-xml @@ -0,0 +1 @@ +Subproject commit 48a7c2b6fb9d515577e115e6788937e837815651 diff --git a/grammars/tree-sitter-yaml b/grammars/tree-sitter-yaml new file mode 160000 index 0000000..80c8d76 --- /dev/null +++ b/grammars/tree-sitter-yaml @@ -0,0 +1 @@ +Subproject commit 80c8d76847f03e772c5c524cf29bafb56858a8d1 diff --git a/grammars/tree-sitter-zig b/grammars/tree-sitter-zig new file mode 160000 index 0000000..0d08703 --- /dev/null +++ b/grammars/tree-sitter-zig @@ -0,0 +1 @@ +Subproject commit 0d08703e4c3f426ec61695d7617415fff97029bd