Cue grammar for tree-sitter.
This project uses Nix flakes to provide a
reproducible development environment with tree-sitter, node, bc, and
python3. You need Nix with flakes and nix-command experimental features
enabled (see Nix flakes - Enable flakes).
nix develop
npm installAfter modifying grammar.js, regenerate the parser and run tests:
tree-sitter generate
tree-sitter test# Run all tests (corpus tests + parse real CUE files)
npm test
# Run only tree-sitter corpus tests
tree-sitter test
# Parse example CUE files from cue-lang/cue
script/parse-examples
# Lint grammar.js
npm run lintUsing lazy.nvim
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
--- @type TSConfig
opts = {
ensure_installed = {
"cue",
},
},
---@param opts TSConfig
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}