Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 1.15 KB

README.md

File metadata and controls

24 lines (14 loc) · 1.15 KB

tree-sitter-ledger

A ledger parser built with tree-sitter.

Contributing

Only the Nix toolchain is supported to get the tree-sitter binary. You can add it to your path by running nix develop. The NPM toolchain is best-effort only and not actively maintained.

Regardless, I personally regenerate the code after every merged PR to prevent the risk of a contributor lacing malicious code into the generated output.

Note for nvim-treesitter users

negative_quantity is exposed by tree-sitter-ledger, but not treated specially in nvim-treesitter. You can add special highlighting for it (e.g. to highlight negative quantities in red) by runnning :TSEditQueryUserAfter and filling in something like:

;; extends
((negative_quantity) @some_capture)

where @some_capture should map to some highlight group in your colorscheme.

Note for integration maintainers

I also maintain the ledger queries in nvim-treesitter. Consider consulting them for hints about what tree-sitter-ledger exposes.