Skip to content

kylo252/tree-sitter-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-registry

A vcpkg registry for building and installing tree-sitter parsers.

The plan is to eventually upstream all of this, see microsoft/vcpkg#26272

Features

  • cross-platform support powered by cmake and vcpkg
  • allows both dynamic and static builds
  • strict ABI versioning, but can still be overridden with --overlay-ports=<path>
  • helper function for integrating additional parsers, see ports/tree-sitter-common

How to use it?

  • install vcpkg
  • copy both config files from example into the desired folder
  • run vcpkg install (a.k.a. manifest mode) in that folder

Check .github/workflows/vcpkg.yml for a full example.

How does it work?

use a common CMakeLists.txt that knows how to build all these parsers.

Background about parsers
  • each parser requires building one or two C/C++ generated files (parser.c, scanner.[c|cc])
  • the generated files do not include any external C/C++ dependencies
  • currently, these generated files are checked in into the repo, but the might change
  • tree-sitter-cli is used to generate these files in case of an ABI version mismatch

    Tree-sitter grammars are written in JavaScript, and Tree-sitter uses Node.js to interpret JavaScript files. It requires the node command to be in one of the directories in your PATH. You’ll need Node.js version 6.0 or greater.

ABI stability

The Tree-sitter library can be used with language parsers that were built with an older version of Tree-sitter, but the reverse does not work. The exact language versions that work with the current library version are defined by these two constants in api.h.

I'm currently imposing a specific ABI version, but still trying to make it clear how to override it, which requires tree-sitter-cli

Available parsers

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published