Metadata-Version: 2.4
Name: tree-sitter-kedi
Version: 0.1.0
Summary: Kedi grammar for tree-sitter
Author-email: Doğukan Yiğit Polat <yigit@neurograph.net>, Mert Sırakaya <mert@kedi-lang.org>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/kedi-lang/tree-sitter-kedi
Project-URL: Repository, https://github.com/kedi-lang/tree-sitter-kedi
Project-URL: Issues, https://github.com/kedi-lang/tree-sitter-kedi/issues
Keywords: kedi,tree-sitter,parser,dsl
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.25
Dynamic: license-file

# tree-sitter-kedi

Tree-sitter grammar for the [Kedi](https://github.com/kedi-lang/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`:

```sh
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`:

```sh
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 rules
- `src/scanner.c` — external scanner (indent stack, fenced blocks, line continuation)
- `src/parser.c` — generated; vendored so consumers don't need the CLI
- `queries/` — highlight / locals / injection queries for editors
- `bindings/python/` — Python C extension exposing `language()`
- `test/corpus/` — tree-sitter test framework cases
