Tree-sitter grammars for Haskell's Cabal build system.
- tree-sitter-cabal —
.cabalpackage description files - tree-sitter-cabal-project —
cabal.project/*.projectworkspace files
The .cabal grammar was initially forked from magus/tree-sitter-cabal.
nix develop # enter dev shell (provides tree-sitter, just, etc.)All commands run across both grammars via the top-level justfile.
| Command | Description |
|---|---|
just |
Run all tests (default) |
just test |
Grammar unit tests + parse-corpus check |
just build |
Generate parser and build shared library |
just check |
Validate grammar without building |
just fmt |
Format grammar files (prettier + nixfmt) |
just clean |
Remove build artifacts |
Per-grammar commands are available as just cabal::<cmd> and just cabal-project::<cmd>.
The test target includes a corpus parse over the same test set from the Cabal source files (from the cabal repo) to catch regressions not covered by the inline test cases.
Disclaimer: Co-produced with a coding agent.