tree-sitter-tql

module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT

README ΒΆ

Tree-sitter TQL 🌳

This repository hosts the tree-sitter grammar for TQL, the Tenzir Query Language.

Features:

  • πŸš€ Complete syntax support for TQL pipelines, operators, and expressions
  • πŸ“ Proper handling of significant newlines and pipe separators
  • πŸ”’ Support for all TQL literal types, including strings, numbers, IP addresses, and durations
  • πŸ”€ Control flow structures, including if, else, and match
  • πŸ“¦ Module paths and function calls
  • πŸ’¬ Line and block comments
  • 🧠 Tree-sitter queries for highlights, indentation, folds, injections, and locals

Usage

See the official Tenzir documentation for editor setup instructions: Set up syntax highlighting.

Development

Contributions are welcome! πŸŽ‰

Setup
  1. Clone the repository and install dependencies:

    git clone https://github.com/tenzir/tree-sitter-tql
    cd tree-sitter-tql
    npm install
    npm exec lefthook -- install
    
  2. Regenerate the parser (and highlights) when needed:

    npm run generate
    

[!NOTE] Highlights, indentation, folding, and locals queries stay in sync because they are generated and committed alongside the parser. CI re-runs the generator and fails if the checked-in files would change, so always execute npm run generate after touching the grammar or related constants.

Playground

To interactively test the grammar:

npm run start
# or
npx tree-sitter playground

This opens a web interface where you can input TQL code and see the parse tree in real time.

License

This project is licensed under the MIT License.

Directories ΒΆ

Path Synopsis
bindings
go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL