6 releases (breaking)

new 0.5.0 Jan 10, 2025
0.3.0 Oct 29, 2024
0.2.0 Oct 25, 2024
0.1.1 Sep 6, 2024
0.0.1 May 14, 2024

#165 in Parser tooling

Download history 30/week @ 2024-09-22 21/week @ 2024-09-29 1/week @ 2024-10-06 124/week @ 2024-10-20 150/week @ 2024-10-27 7/week @ 2024-11-03 4/week @ 2024-11-17 1/week @ 2024-11-24 30/week @ 2024-12-08 1/week @ 2024-12-15 61/week @ 2025-01-05

62 downloads per month
Used in rigz

MIT license

1.5MB
51K SLoC

C 50K SLoC JavaScript 176 SLoC // 0.1% comments Scheme 56 SLoC Rust 31 SLoC // 0.2% comments

tree-sitter-rigz

Setup for Neovim

  1. Add the following to init.lua
vim.filetype.add({
  extension = {
    rigz = "rigz",
  },
})

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.rigz = {
  install_info = {
    url = "~/parsers/tree-sitter-rigz", -- local path or git repo
    files = {"src/parser.c"},
    generate_requires_npm = false, -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
    branch = "main", -- default branch is not master
    filetype = 'rigz',
  },
}
  1. curl "https://gitlab.com/magicfoodhand/tree-sitter-rigz/-/raw/main/queries/highlights.scm?ref_type=heads" -o ~/.local/share/nvim/lazy/nvim-treesitter/queries/rigz/highlights.scm

Rust Derive Macro Highlighting

(macro_invocation
  (scoped_identifier
    name: (identifier) @name (#eq? @name derive_module!))

  (token_tree (raw_string_literal) @rigz_string)
)

(macro_invocation
  (scoped_identifier
    path: (identifier) @path (#eq? @path rigz_ast_derive)
    name: (identifier) @name (#eq? @name derive_module!))

  (token_tree (raw_string_literal) @rigz_string)
)

Dependencies

~4–310KB