Kevin Schoon 10 months ago
10 commits
63ec8ac1 main
split up build steps
file commit size mode time
.gitignore split up build steps 38 B -rw-r--r-- 10 months ago
.gitmodules init 3.4 KiB -rw-r--r-- 1 year ago
README.md split up build steps 1.6 KiB -rw-r--r-- 10 months ago
compile.py split up build steps 787 B -rwxr-xr-x 10 months ago
fixes.sed split up build steps 48 B -rw-r--r-- 10 months ago
generate.py split up build steps 890 B -rwxr-xr-x 10 months ago
grammars.json split up build steps 2.1 KiB -rw-r--r-- 10 months ago
grammars bump submodules NaN B d--------- 10 months 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 10 months 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

aur

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

Clone

HTTP

Subscribe

License

Authors

Kevin Schoon: 100%

Analysis

Recent Activity (90 days) 0 10 20 30 40 50 60 70 80 90 Composition [179 LOC] Python JSON Shell Markdown 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%