https://github.com/datwaft/tree-sitter-corpus
A tree-sitter parser for tree-sitter's test files
https://github.com/datwaft/tree-sitter-corpus
corpus grammar tests tree-sitter tree-sitter-grammar tree-sitter-parser
Last synced: 5 months ago
JSON representation
A tree-sitter parser for tree-sitter's test files
- Host: GitHub
- URL: https://github.com/datwaft/tree-sitter-corpus
- Owner: datwaft
- Created: 2024-03-24T00:50:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T07:22:41.000Z (about 2 years ago)
- Last Synced: 2025-02-12T22:47:52.986Z (over 1 year ago)
- Topics: corpus, grammar, tests, tree-sitter, tree-sitter-grammar, tree-sitter-parser
- Language: C
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tree-sitter grammar for tree-sitter test files (corpus files)
Hello!
I created this grammar as a learning exercise and because I wanted to have highlighting when creating tests for tree-sitter grammars. I have a previous version of this using vim regex parsing [here](https://github.com/datwaft/corpus.vim), if you want to see it (it is now archived as this works a lot better).
This grammar is supposed to be usable out of the box so if you have any issues or enhancements feel free to open an [issue](https://github.com/datwaft/tree-sitter-corpus/issues/new/choose) or a [PR](https://github.com/datwaft/tree-sitter-corpus/compare).
## How do I install this grammar?
I may create a PR into the [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) repository in the future but meanwhile you can install it like this (example for [`lazy.nvim`](https://github.com/folke/lazy.nvim)):
```lua
{
"datwaft/tree-sitter-corpus",
dependencies = { "nvim-treesitter/nvim-treesitter" },
build = ":TSUpdate corpus",
}
```
The grammar contains its own queries and configures itself, so you don't need to do anything else.
## Screenshots?
Here are some screenshots (my colorscheme is [catppuccin](https://github.com/catppuccin/nvim), my terminal is [Wezterm](https://wezfurlong.org/wezterm/index.html) and my font is [Iosevka](https://github.com/be5invis/Iosevka)):

