{"id":51035483,"url":"https://github.com/devzolo/tree-sitter-zolo","last_synced_at":"2026-06-22T05:30:43.632Z","repository":{"id":366266267,"uuid":"1254602432","full_name":"devzolo/tree-sitter-zolo","owner":"devzolo","description":"Official tree-sitter grammar for the Zolo language","archived":false,"fork":false,"pushed_at":"2026-06-21T02:17:36.000Z","size":4573,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-21T04:10:58.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devzolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T19:23:03.000Z","updated_at":"2026-06-21T02:17:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devzolo/tree-sitter-zolo","commit_stats":null,"previous_names":["devzolo/tree-sitter-zolo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/devzolo/tree-sitter-zolo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzolo%2Ftree-sitter-zolo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzolo%2Ftree-sitter-zolo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzolo%2Ftree-sitter-zolo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzolo%2Ftree-sitter-zolo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devzolo","download_url":"https://codeload.github.com/devzolo/tree-sitter-zolo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzolo%2Ftree-sitter-zolo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34636427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-22T05:30:42.787Z","updated_at":"2026-06-22T05:30:43.627Z","avatar_url":"https://github.com/devzolo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-sitter-zolo\n\nOfficial [tree-sitter](https://tree-sitter.github.io/) grammar for the\n[Zolo](https://github.com/devzolo/zolo-lang) language — a modern, typed\nlanguage that compiles to Lua 5.1.\n\nThis package provides the incremental parser used by editors such as Neovim,\nHelix, Zed, Emacs and GitHub for syntax highlighting, folding, structural\nnavigation and refactoring.\n\n## Features covered\n\n- Top-level items: `fn`, `fn*` (generator), `struct`, `enum`, `trait`, `impl`, `use`, `mod`, `type`, `newtype`, `const`, `const_assert`, `macro`, `on`\n- Decorators: `@derive(Eq, Hash)`, `@get(\"/path\")`, `@memoize`, etc.\n- Expressions: literals, calls, methods, `?.`, `??`, `?`, `..`, `..=`, `|\u003e`, `\u0026.`, `as`, `is`\n- Match with guards and patterns (struct, enum, tuple, array, range, or, `@` binding)\n- Generics `\u003cT: Bound\u003e` and `where` clauses\n- Async/await, `yield`, `spawn`, `every`, `after`, `timeout`, `sleep`\n- Try/catch/finally and `defer`\n- Lambdas `|x| expr` or `|x| { ... }`\n- String interpolation: `\"hello {name}\"`\n- Temporal literals: `5s`, `100ms`, `30min`, `2h`, `1d`, `1w`\n- Tagged templates: `sql\"...\"`, `html\"...\"`, etc.\n- Declarative macros (`macro name(args) { ... }`) and invocation `name!(...)`\n\n## Repository layout\n\n```text\ntree-sitter-zolo/\n├── grammar.js            # the grammar (source of truth)\n├── src/                  # generated parser — regenerate with `tree-sitter generate`\n├── queries/              # canonical queries (tree-sitter layout: queries/*.scm)\n│   ├── highlights.scm\n│   ├── folds.scm\n│   ├── indents.scm\n│   ├── injections.scm\n│   └── locals.scm\n├── editors/nvim/         # drop-in Neovim plugin (see editors/nvim/README.md)\n├── test/corpus/          # parser test cases\n└── bindings/             # Node and Rust bindings\n```\n\n\u003e **Query layout note.** The grammar keeps queries flat in `queries/*.scm`\n\u003e (the tree-sitter convention, used by Helix/Zed/etc.). Neovim instead expects\n\u003e `queries/\u003clang\u003e/*.scm`, so the bundled plugin ships them under\n\u003e `editors/nvim/queries/zolo/`, kept in sync from `queries/` by\n\u003e `editors/nvim/scripts/sync-queries.{ps1,sh}`.\n\n## Editor integration — prerequisites\n\n- **Neovim** 0.9+ (0.10+ recommended; the nvim-treesitter `main` branch tracks\n  the latest Neovim).\n- **A C compiler on `PATH`** to build the parser:\n\n  | OS | Compiler |\n  | --- | --- |\n  | Windows | `gcc` via [MSYS2](https://www.msys2.org/) / mingw-w64, or `zig cc`, or MSVC `cl` |\n  | macOS | `clang` (`xcode-select --install`) |\n  | Linux | `gcc` or `clang` |\n\n- The [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter) and Node.js\n  to generate `src/parser.c` from `grammar.js`. The generated parser is\n  **git-ignored** (not committed), so you generate it once per clone — the\n  sections below say where.\n\nThe parser has **no external scanner** (only `src/parser.c`), so building it is\na single-file compile.\n\n## Neovim — quick start (recommended)\n\nUse the bundled plugin in [`editors/nvim`](editors/nvim). It registers the\nfiletype, registers the parser (pointed at this local checkout) and ships the\nqueries. Load it from a **local path** with your plugin manager — replace the\npath with your `zolo-lang` clone (forward slashes work on Windows):\n\n```lua\n-- lazy.nvim\n{\n  dir = \"/path/to/zolo-lang/tree-sitter-zolo/editors/nvim\",\n  dependencies = { \"nvim-treesitter/nvim-treesitter\" },\n  lazy = false, -- load at startup so :TSInstall zolo is available immediately\n}\n```\n\nThen, inside Neovim:\n\n```vim\n:TSInstall zolo      \" compile the parser from the local grammar\n:edit example.zolo   \" highlighting, folding and indentation are now active\n```\n\nUse `:TSInstall! zolo` to force a rebuild after you change the grammar.\n\n**Generated parser.** `src/parser.c` is git-ignored (produced by\n`tree-sitter generate`), so it is not committed. In a fresh clone, generate it\nonce before the first `:TSInstall`:\n\n```bash\ncd /path/to/zolo-lang/tree-sitter-zolo\ntree-sitter generate\n```\n\nThe bundled plugin points `:TSInstall zolo` at your local checkout and compiles\nthat file, so afterwards you only need a C compiler.\n\n## Neovim — other plugin managers\n\nThe bundled plugin lives in a subdirectory of this monorepo, so install it by\n**local path**. After loading it, run `:TSInstall zolo` once.\n\n### packer.nvim\n\n```lua\nuse {\n  \"/path/to/zolo-lang/tree-sitter-zolo/editors/nvim\",\n  after = \"nvim-treesitter\",\n}\n```\n\n### vim-plug\n\n```vim\nPlug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }\nPlug '/path/to/zolo-lang/tree-sitter-zolo/editors/nvim'\n```\n\n### No plugin manager (runtimepath)\n\n```lua\nvim.opt.runtimepath:append(\"/path/to/zolo-lang/tree-sitter-zolo/editors/nvim\")\n```\n\nor in Vimscript:\n\n```vim\nset runtimepath+=/path/to/zolo-lang/tree-sitter-zolo/editors/nvim\n```\n\n## Neovim — nvim-treesitter without the bundled plugin\n\nIf you only want the parser from GitHub (no local clone of the bundled plugin),\nregister it directly. nvim-treesitter has two branches with different APIs.\n\n### nvim-treesitter `master` branch (classic)\n\n```lua\nlocal parser_config = require(\"nvim-treesitter.parsers\").get_parser_configs()\nparser_config.zolo = {\n  install_info = {\n    url = \"https://github.com/devzolo/zolo-lang\",\n    branch = \"main\",\n    location = \"tree-sitter-zolo\",   -- parser lives in this monorepo subdirectory\n    files = { \"src/parser.c\" },\n    requires_generate_from_grammar = true, -- src/parser.c is git-ignored; regenerate on install\n  },\n  filetype = \"zolo\",\n}\n\nvim.filetype.add({ extension = { zolo = \"zolo\" } })\n```\n\n### nvim-treesitter `main` branch (rewrite)\n\n```lua\nvim.api.nvim_create_autocmd(\"User\", {\n  pattern = \"TSUpdate\",\n  callback = function()\n    require(\"nvim-treesitter.parsers\").zolo = {\n      install_info = {\n        url = \"https://github.com/devzolo/zolo-lang\",\n        branch = \"main\",\n        location = \"tree-sitter-zolo\",\n        generate = true, -- src/parser.c is git-ignored; regenerate on install\n        -- queries = \"tree-sitter-zolo/queries\", -- also install queries from the repo\n      },\n    }\n  end,\n})\n\nvim.filetype.add({ extension = { zolo = \"zolo\" } })\n```\n\nThen `:TSInstall zolo`. Because the repository does not ship the generated\nparser, both snippets tell nvim-treesitter to regenerate it on install — this\nneeds Node.js and the tree-sitter CLI available where you run `:TSInstall`.\n\n**Queries.** On the `master` branch nvim-treesitter installs only the *parser*,\nnot the grammar's queries. Copy them into your config so Neovim can find them\nunder `queries/\u003clang\u003e/` (the bundled plugin does this for you):\n\n```bash\n# from your Neovim config directory\n#   Linux/macOS: ~/.config/nvim\n#   Windows:     %LOCALAPPDATA%\\nvim\nmkdir -p queries/zolo\ncp /path/to/zolo-lang/tree-sitter-zolo/queries/*.scm queries/zolo/\n```\n\n## Neovim — without nvim-treesitter (built-in tree-sitter)\n\nNeovim 0.9+ can run the parser directly, no nvim-treesitter required.\n\n1. Generate (in a fresh clone `src/parser.c` is git-ignored) and build the\n   parser into your config's `parser/` directory:\n\n   ```bash\n   # Linux/macOS\n   cd /path/to/zolo-lang/tree-sitter-zolo\n   tree-sitter generate            # only if src/parser.c is missing\n   cc -o ~/.config/nvim/parser/zolo.so -shared -Isrc src/parser.c -Os -fPIC\n   ```\n\n   ```powershell\n   # Windows (gcc from MSYS2); Neovim still expects the .so suffix\n   cd V:\\path\\to\\zolo-lang\\tree-sitter-zolo\n   tree-sitter generate            # only if src/parser.c is missing\n   gcc -o \"$env:LOCALAPPDATA\\nvim\\parser\\zolo.so\" -shared -Isrc src/parser.c -Os\n   ```\n\n2. Provide the queries and filetype by loading the bundled\n   [`editors/nvim`](editors/nvim) plugin (it ships `queries/zolo/`, `ftdetect/`\n   and an `ftplugin` that calls `vim.treesitter.start()`), or do it by hand:\n   copy `queries/*.scm` into `\u003cconfig\u003e/queries/zolo/`, add\n   `vim.filetype.add({ extension = { zolo = \"zolo\" } })`, and start highlighting\n   on the `zolo` filetype with `vim.treesitter.start()`.\n\n## Neovim — verifying and troubleshooting\n\n```vim\n:checkhealth nvim-treesitter   \" compiler + parser status (nvim-treesitter)\n:TSInstallInfo zolo            \" is the parser installed? (master branch)\n:edit example.zolo\n:Inspect                       \" show the capture/highlight under the cursor\n:InspectTree                   \" show the live syntax tree\n```\n\n- **`no parser for 'zolo'` / no highlighting** — the parser is not installed or\n  not built. Run `:TSInstall zolo` (or build it manually, above) and confirm a C\n  compiler is on `PATH`.\n- **Parser installs but nothing is highlighted** — the queries aren't on\n  `runtimepath`. Use the bundled plugin or copy `queries/*.scm` to\n  `\u003cconfig\u003e/queries/zolo/`.\n- **`:set filetype?` is not `zolo`** — add\n  `vim.filetype.add({ extension = { zolo = \"zolo\" } })` (the bundled plugin does\n  this).\n- **Windows: compiler errors** — install MSYS2 and add `…\\msys64\\mingw64\\bin`\n  to `PATH`, or use `zig cc`.\n- **Grammar changed but highlights are stale** — rebuild with `:TSInstall! zolo`.\n\n## Helix\n\nHelix compiles grammars at build time. In your Helix `languages.toml`:\n\n```toml\n[[language]]\nname = \"zolo\"\nscope = \"source.zolo\"\nfile-types = [\"zolo\"]\ncomment-token = \"//\"\nindent = { tab-width = 4, unit = \"    \" }\n\n[[grammar]]\nname = \"zolo\"\nsource = { path = \"/path/to/zolo-lang/tree-sitter-zolo\" }\n```\n\nThen fetch/build the grammar and install the queries into Helix's runtime:\n\n```bash\nhx --grammar fetch\nhx --grammar build\n\n# Helix expects queries under runtime/queries/\u003clang\u003e/\nmkdir -p ~/.config/helix/runtime/queries/zolo\ncp /path/to/zolo-lang/tree-sitter-zolo/queries/*.scm ~/.config/helix/runtime/queries/zolo/\n```\n\n## Building and development\n\nInstall dev dependencies:\n\n```bash\ncd tree-sitter-zolo\nnpm install\n```\n\nRegenerate the parser from `grammar.js` (run this whenever the grammar changes —\nthe committed `src/parser.c` must stay in sync):\n\n```bash\ntree-sitter generate           # or: npx tree-sitter generate\n```\n\nRun the parser test corpus:\n\n```bash\ntree-sitter test               # cases live in test/corpus/*.txt\n```\n\nBuild the native bindings:\n\n```bash\nnpm run build                  # Node bindings\ncargo build                    # Rust bindings\n```\n\n## Known limitations\n\n- Macro bodies are parsed as a generic block — `$param` placeholders are not\n  expanded during parsing.\n- `comptime` blocks have no dedicated rule yet (they fall back to `block`).\n- Some rare interpolation forms with a complex format spec may need tweaks.\n- Tagged templates assume the tag name is a simple ASCII identifier.\n\n## License\n\nMIT — same license as the Zolo project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevzolo%2Ftree-sitter-zolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevzolo%2Ftree-sitter-zolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevzolo%2Ftree-sitter-zolo/lists"}