2 stable releases

1.0.2 Feb 23, 2025

#2345 in Parser implementations

Download history 201/week @ 2025-02-19 60/week @ 2025-02-26

261 downloads per month
Used in tjq

GPL-3.0-or-later

330KB
13K SLoC

C 13K SLoC JavaScript 368 SLoC // 0.1% comments Rust 32 SLoC // 0.1% comments Scheme 20 SLoC

tree-sitter-jq

License: GPL v3

Jq language grammar for tree-sitter.

References


lib.rs:

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

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

let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_jq::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Jq parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~4–310KB