TSDL
A downloader/builder of many tree-sitter parsers
Why?
To build parsers (.so/.dylib) and use them with your favourite bindings.
I created it more specifically for the ruby bindings.
Installation
You can either grab the binary for your platform from
tsdl's releases
or install via cargo:
Usage
To build a parser:
To build many parsers:
If a configuration file (parsers.toml) is provided, then simply running:
will download all the pinned parsers.
Configuration
If no configuration is provided for the language you're asking for in parsers.toml,
the latest parsers will be downloaded built.
If you wish to pin parser versions:
[]
= "v0.21.0"
= "0.21.0" # The leading v is not necessary
= "master"
= { = "0.21.0", = "make" }
= { = "6a469068cacb5e3955bb16ad8dfff0dd792883c9", = "https://github.com/yutaro-sakamoto/tree-sitter-cobol" }
Run:
to get the default config used by tsdl in TOML.
[!IMPORTANT] All configuration you can pass to
tsd buildcan be put in theparsers.toml, liketree-sitter-version,out-dir, etc.= "/tmp/tsdl" = "/usr/local/lib" [] = "0.21.0" # The leading v is not necessary = "master"
[!IMPORTANT] All configuration specified in
parsers.tomlcan be overridden with flags passed totsdl, i.e.:tsdl build --build-dir "/tmp/tsdl"will override whatever value is the default oftsdlor inparsers.toml.
[!TIP] Check out Faveod/tree-sitter-parsers for an example configuration.