├── .github ├── dependabot.yml └── workflows │ └── main.yml ├── .gitignore ├── README └── batch.sh /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | README 3 | !emacs-module.h 4 | !tree-sitter-lang.in 5 | !languages.txt 6 | !batch.sh.old 7 | !batch.sh 8 | !build.sh.old 9 | !build.sh 10 | !.github/ 11 | !.github/** 12 | !.gitignore 13 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is an unofficial script that builds tree-sitter grammars that can 2 | be used by Emacs 29 and above. 3 | 4 | Tree-sitter language grammars are just dynamic library object files. 5 | You need git and a C/C++ compiler to build them. 6 | 7 | To build the language grammar for a particular language, run 8 | 9 | ./build.sh 10 | 11 | e.g., 12 | 13 | ./build.sh html 14 | 15 | The dynamic library will be in directory /dist. 16 | 17 | To build all modules at once, run 18 | 19 | ./batch.sh 20 | 21 | This gives you C, JSON, Go, HTML, Javascript, CSS, Python, Typescript 22 | (tsx), C# (csharp), C++ (cpp), Rust, etc, etc. The complete list is in 23 | batch.sh. If you don't see your favoriate language in the list, submit 24 | a PR. 25 | 26 | You can enable parallel build with the JOBS variable, like this: 27 | 28 | JOBS=8 ./batch.sh -------------------------------------------------------------------------------- /batch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -u 4 | set -e 5 | 6 | # List of supported languages. Please keep this array sorted alphabetically for ease of maintenance 7 | # and readability. 8 | languages=( 9 | 'ada' 10 | 'astro' 11 | 'bash' 12 | 'bison' 13 | 'c' 14 | 'c3' 15 | 'c-sharp' 16 | 'clojure' 17 | 'cmake' 18 | 'cpp' 19 | 'css' 20 | 'cylc' 21 | 'dart' 22 | 'dockerfile' 23 | 'doxygen' 24 | 'elisp' 25 | 'elixir' 26 | 'erlang' 27 | 'glsl' 28 | 'go' 29 | 'gomod' 30 | 'gowork' 31 | 'gpr' 32 | 'haskell' 33 | 'heex' 34 | 'html' 35 | 'janet-simple' 36 | 'java' 37 | 'javascript' 38 | 'jsdoc' 39 | 'json' 40 | 'julia' 41 | 'kotlin' 42 | 'lua' 43 | 'magik' 44 | 'make' 45 | 'markdown' 46 | 'markdown-inline' 47 | 'nix' 48 | 'org' 49 | 'perl' 50 | 'php' 51 | 'proto' 52 | 'python' 53 | 'ruby' 54 | 'rust' 55 | 'scala' 56 | 'scss' 57 | 'sdml' 58 | 'souffle' 59 | 'sql' 60 | 'surface' 61 | 'svelte' 62 | 'toml' 63 | 'tsx' 64 | 'typescript' 65 | 'typst' 66 | 'vala' 67 | 'verilog' 68 | 'vhdl' 69 | 'wgsl' 70 | 'yaml' 71 | 'zig' 72 | ) 73 | 74 | if [ -z "${JOBS:-}" ] 75 | then 76 | for language in "${languages[@]}" 77 | do 78 | ./build.sh "${language}" 79 | done 80 | else 81 | printf "%s\n" "${languages[@]}" | xargs -P"${JOBS}" -n1 ./build.sh 82 | fi 83 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ${{ matrix.os }} 22 | strategy: 23 | fail-fast: true 24 | matrix: 25 | os: [macos-latest, ubuntu-latest, windows-latest] 26 | include: 27 | - { os: macos-latest, shell: bash } 28 | - { os: ubuntu-latest, shell: bash } 29 | - { os: windows-latest, shell: msys2, sys: mingw64 } 30 | defaults: 31 | run: 32 | shell: ${{ matrix.shell }} {0} 33 | 34 | # Steps represent a sequence of tasks that will be executed as part of the job 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v5 38 | 39 | - name: Setup MSYS2 40 | if: runner.os == 'Windows' 41 | uses: msys2/setup-msys2@v2 42 | with: 43 | msystem: ${{ matrix.sys }} 44 | install: git zip 45 | pacboy: gcc:p 46 | 47 | - name: Build 48 | run: | 49 | ./batch.sh 50 | export platform=$(echo ${{ runner.os }} | awk '{print tolower($0)}') 51 | zip -r "libs-${platform}-x64.zip" dist 52 | 53 | - name: Release 54 | uses: softprops/action-gh-release@v2 55 | with: 56 | draft: true 57 | files: libs-*.zip 58 | --------------------------------------------------------------------------------