split up build steps
File | Commit | Size | Mode | Time |
---|---|---|---|---|
.gitignore | split up build steps | 38 B | -rw-r--r-- | 1 year ago |
.gitmodules | init | 3.4 KiB | -rw-r--r-- | 1 year ago |
README.md | split up build steps | 1.6 KiB | -rw-r--r-- | 1 year ago |
compile.py | split up build steps | 787 B | -rwxr-xr-x | 1 year ago |
fixes.sed | split up build steps | 48 B | -rw-r--r-- | 1 year ago |
generate.py | split up build steps | 890 B | -rwxr-xr-x | 1 year ago |
grammars.json | split up build steps | 2.1 KiB | -rw-r--r-- | 1 year ago |
grammars | bump submodules | NaN B | d--------- | 1 year ago |
install.sh | refactor build script | 1 KiB | -rwxr-xr-x | 1 year ago |
package.py | split up build steps | 2.4 KiB | -rwxr-xr-x | 1 year ago |
uninstall.sh | add installer script | 95 B | -rwxr-xr-x | 1 year ago |
tree-sitter-amalgamation
All of the 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
Manual Installation
sudo ./install.sh
# uninstall
sudo ./uninstall.sh
Compiling
You need to install ninja to build the project as well as an ANSI C compiler.
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
# 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.
/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