#cql #parser #incremental

bin+lib tree-sitter-cql

cql grammar for the tree-sitter parsing library

4 releases (2 breaking)

0.2.0 May 9, 2024
0.1.2 May 8, 2024
0.1.1 Jun 24, 2022
0.1.0 May 20, 2022
0.0.1 Apr 29, 2022

#96 in Text editors

Download history 319/week @ 2024-01-29 384/week @ 2024-02-05 210/week @ 2024-02-12 421/week @ 2024-02-19 204/week @ 2024-02-26 217/week @ 2024-03-04 187/week @ 2024-03-11 256/week @ 2024-03-18 108/week @ 2024-03-25 440/week @ 2024-04-01 48/week @ 2024-04-08 224/week @ 2024-04-15 195/week @ 2024-04-22 375/week @ 2024-04-29 522/week @ 2024-05-06 196/week @ 2024-05-13

1,290 downloads per month
Used in 2 crates (via cql3-parser)

MIT license

730KB
23K SLoC

C 22K SLoC JavaScript 865 SLoC Rust 166 SLoC // 0.3% comments

Usage

Add the following line to Cargo.toml.

tree-sitter-cql = "0.0.1"

Regenerate

  1. Make changes to grammar.js
  2. Run cargo install tree-sitter-cli
  3. Ensure that .cargo/bin is in your $PATH
  4. Install nodejs. Possibly pacman -Syu nodejs or apt-get install nodejs.
  5. Run tree-sitter generate

lib.rs:

This crate provides cql 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_cql::language()).expect("Error loading cql grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~71K SLoC