Kedi grammar for tree-sitter
Project description
tree-sitter-kedi
Tree-sitter grammar for the Kedi DSL.
This package replaces Kedi's previous hand-written parser with a tree-sitter generated parser, enabling:
- Editor syntax highlighting (
queries/highlights.scm) - Scope-aware LSP features (
queries/locals.scm) - Embedded Python highlighting inside fenced and backtick regions
(
queries/injections.scm) - Incremental parsing for editor performance
- Rich error spans with line/column information
Development
Generating the parser from grammar.js:
npm install # installs tree-sitter-cli locally
npm run generate # writes src/parser.c
npm test # runs corpus tests in test/corpus/
The generated src/parser.c, src/grammar.json, and src/node-types.json
are committed so downstream editor extensions can consume a pinned revision
without requiring code generation.
Python consumption
Built as a Python wheel via setuptools:
pip install -e .
python -c "import tree_sitter_kedi; from tree_sitter import Language, Parser; \
Parser(Language(tree_sitter_kedi.language()))"
Layout
grammar.js— grammar rulessrc/scanner.c— external scanner (indent stack, fenced blocks, line continuation)src/parser.c— generated; vendored so consumers don't need the CLIqueries/— highlight / locals / injection queries for editorsbindings/python/— Python C extension exposinglanguage()test/corpus/— tree-sitter test framework cases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tree_sitter_kedi-0.1.0.tar.gz
(47.2 kB
view details)
File details
Details for the file tree_sitter_kedi-0.1.0.tar.gz.
File metadata
- Download URL: tree_sitter_kedi-0.1.0.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0d6aa83737b10b036f7a49dd5bb4f9ebdc335da9ed970cf59845039ab61a2d9
|
|
| MD5 |
cc61b7dfbe7ec0cffbbdca2ef58f7f04
|
|
| BLAKE2b-256 |
e4b872ac8983d45ea887f14a0156bb191bcfdf7ef41b536eb1d5b9b8132c9e02
|