parse #!/usr/bin/env nix-shell scripts with tree-sitter
Go to file
Colin c2fcc8b6ee implement very basic highlighting 2023-07-07 03:21:04 +00:00
tests implement very basic highlighting 2023-07-07 03:21:04 +00:00
tree-sitter-nix-shell implement very basic highlighting 2023-07-07 03:21:04 +00:00
Makefile implement very basic highlighting 2023-07-07 03:21:04 +00:00
README.md add a `nix run '.#clean'` rule 2023-07-06 22:39:50 +00:00
default.nix implement very basic highlighting 2023-07-07 03:21:04 +00:00
flake.lock implement very basic highlighting 2023-07-07 03:21:04 +00:00
flake.nix implement very basic highlighting 2023-07-07 03:21:04 +00:00
shell.nix implement very basic highlighting 2023-07-07 03:21:04 +00:00

README.md

this will be a tree-sitter implementation for nix-shell files.

try one of the following:

  • nix build => build the parser
  • nix develop => manually/interactively generate the parser
    • tree-sitter generate

non-flake equivalents:

  • nix-build
  • nix-shell

development workflow

guide on using tree-sitter: https://tree-sitter.github.io/tree-sitter/creating-parsers

roughly:

  1. nix develop
  2. tree-sitter generate
  3. tree-sitter test

run nix run '.#clean' before committing to avoid checking in build artifacts.

the parser is defined in grammar.js, and tests live in corpus/.