Tree Sitter Jakt
Jakt grammar for tree-sitter
Jakt is a memory safe programming language built for SerenityOS that transpiles to C++.
Work in progress.
How to run tests
The tree-sitter cli is required to run tests.
tree-sitter generate && tree-sitter test
How to install in Neovim
Note: this step is only temporary. The highlighter will eventually be added to the nvim-tressitter project to be included with neovim.
-
Add the following to the neovim config:
local parser_config = require "nvim-treesitter.parsers".get_parser_configs() parser_config.jakt = { install_info = { url = "https://github.com/demizer/tree-sitter-jakt.git", -- local path or git repo files = {"src/parser.c", "src/scanner.c"}, -- optional entries: branch = "main", -- default branch in case of git repo if different from master generate_requires_npm = false, -- if stand-alone parser without npm dependencies requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c }, }
-
Manually install the highlighter
See nvim-treesitter instructions
highlights.scm
is contained in the tree-sitter-jakt repository.mkdir -p ~/.config/nvim/queries/jakt cp queries/highlights.scm ~/.config/nvim/queries/jakt/
-
Install tree-sitter-jakt using neovim
:TSInstall jakt
-
checkhealth in neovim
:checkhealth
-
jakt
should be contained in the tree-sitter parsers and should it should have a check underhighlight
. -
Load a jakt source file and set filetype to jakt and enjoy