Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamestrew/tree-sitter-monkey
Monkey grammar for tree-sitter
https://github.com/jamestrew/tree-sitter-monkey
tree-sitter tree-sitter-parser
Last synced: 20 days ago
JSON representation
Monkey grammar for tree-sitter
- Host: GitHub
- URL: https://github.com/jamestrew/tree-sitter-monkey
- Owner: jamestrew
- License: mit
- Created: 2022-10-29T21:47:50.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-18T01:40:31.000Z (almost 2 years ago)
- Last Synced: 2024-07-30T20:56:07.916Z (4 months ago)
- Topics: tree-sitter, tree-sitter-parser
- Language: C
- Homepage:
- Size: 103 KB
- Stars: 24
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-monkey
[Monkey](https://interpreterbook.com/) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
![image](https://user-images.githubusercontent.com/66286082/200150413-604390fd-ceed-4320-8699-9ce3fe9a7fab.png)Just learning the basics of tree-sitter
#### Neovim Integration
1. Clone repo
```bash
git clone https://github.com/jamestrew/tree-sitter-monkey.git
```
2. With the `tree-sitter-cli` installed*, run `tree-sitter generate` in the directory where this repo was cloned
3. Add the following snippet to your init.lua
```lua
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.monkey = {
install_info = {
url = "your/path/to/tree-sitter-monkey",
files = {"src/parser.c"},
},
filetype = "mon",
}
```
4. Restart neovim and run `:TSInstall monkey`
5. To get syntax highlighting for `.mon` files:
```bash
mkdir -p ~/.config/nvim/queries/monkey
cp your/path/to/tree-sitter-monkey/queries/highlights.scm ~/.config/nvim/queries/monkey/
```\*`tree-sitter-cli` should already be installed with Neovim. If not see the [tree-sitter docs](https://tree-sitter.github.io/tree-sitter/creating-parsers#installation).