# tree-sitter-amalgamation All of the [tree-sitter](https://tree-sitter.github.io/tree-sitter/) parsers imported as submodules and compiled for easy use by downstream projects. Each parser is exposed as a shared module that can be dynamically loaded in another application. Generated source code is also shipped for use in build scripts. ## Installation The best way to install this is via your package manager. ### Known Distribution Packages [aur](https://aur.archlinux.org/packages/tree-sitter-amalgamation) ### Manual Installation ```sh sudo ./install.sh # uninstall sudo ./uninstall.sh ``` ## Compiling You need to install [ninja](https://ninja-build.org) to build the project as well as an ANSI C compiler. ```sh git submodule update --init --recursive # generate tree-sitter parsers ./generate.py # package all of the parsers into the target directory ./package.py # compile shared parser objects ./compile.py ``` ## Adding New Languages ```sh # add a new submodule to the repository cd grammars && git submodule add $your-tree-sitter-project # edit the build.py package adding your source module and adjust as needed vim build.py # regenerate the build.ninja script python build.py # rebuild the project ninja ``` ## Packagers Suggested filesystem layout for package maintainers. ```text /usr/lib/tree-sitter-amalgamation/$language.so /usr/include/tree-sitter-amalgamation/$language/queries/highlights.scm /usr/include/tree-sitter-amalgamation/$language/parser.c /usr/include/tree-sitter-amalgamation/$language/scanner.c /usr/include/tree-sitter-amalgamation/$language/common/scanner.h ```