#pest #pest-grammar #tree-sitter

tree-sitter-pest

pest grammar for the tree-sitter parsing library

2 releases

0.0.2 Mar 21, 2024
0.0.1 Mar 21, 2024

#480 in Text editors

MIT license

92KB
3.5K SLoC

C 3K SLoC JavaScript 113 SLoC // 0.1% comments Scheme 69 SLoC Rust 31 SLoC // 0.4% comments

tree-sitter-pest

The Pest grammar for the tree-sitter.

Usage

cargo add tree-sitter-pest

License

MIT


lib.rs:

This crate provides pest language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_pest::language()).expect("Error loading pest grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~75K SLoC