pepegsitter

Collection of Tree-Sitter parsers

4 releases

0.2.2 Feb 19, 2024
0.2.1 Nov 26, 2023
0.2.0 Nov 26, 2023
0.1.0 Oct 26, 2022

MIT license

111MB
3.5M SLoC

C 3.5M SLoC // 0.0% comments C++ 24K SLoC // 0.0% comments JavaScript 14K SLoC // 0.0% comments Rust 2.5K SLoC // 0.1% comments Scheme 2.5K SLoC // 0.1% comments

PepegSitter

Crates.io License Build Status docs.rs

A collection of tree sitter parsers packaged into a single crate with tree-sitter-highlight support. The build.rs is also tuned to statically link parsers that depend on libstdc++.

Every parser is included as a git submodule and has it's own Cargo Feature.

Usage

Enable the parsers you need through cargo features, by default all features are enabled.

// Get the TreeSitter language
let _ = pepegsitter::bash::language();
// Get a new `HighlightConfiguration` for the language.
let _ = pepegsitter::bash::highlight();

// Queries are accessible module constants.
let _ = pepegsitter::bash::HIGHLIGHT_QUERY;

Parsers

Currently includes the following parsers:

  • Bash
  • C
  • C++
  • CSS
  • D
  • Go
  • Haskell
  • Html
  • Java
  • JavaScript
  • Json
  • Lua
  • Markdown
  • Python
  • Rust
  • Toml
  • Typescript / TSX
  • Vim
  • Yaml

Dependencies

~2.7–4MB
~76K SLoC