tree-sitter-lmcode
tree-sitter-lmcode is the Tree-sitter grammar and C external scanner for the standalone lmcode language inside _lmcode_ blocks. It parses typed fn declarations, @NAME annotations, implements clauses, qw/qi/qf and %json literals, FIFO heredocs, ${...} splices, and $return assignments.
Quick reference
git clone https://github.com/lmctl-ai/tree-sitter-lmcode.git
cd tree-sitter-lmcode
npm install --prefix /tmp/ts-cli tree-sitter-cli@0.27.1
export PATH="/tmp/ts-cli/node_modules/.bin:$PATH"
tree-sitter generate && tree-sitter test --rebuild
| Component | Version / Kind | Role |
|---|---|---|
| tree-sitter-cli | 0.27.1 | Pinned generator version producing committed src/parser.c, grammar.json, and node-types.json |
| src/parser.c + src/scanner.c | C99 parser sources | Zero-Node native parser and external scanner for FIFO heredocs, qw/qi/qf, and splices |
| function_declaration | AST node | Covers @annotation fn name(params) -> ret implements Interface { ... } |
| return_assignment | AST node | Assignment-only $return, $return.name, and $return[expr] target nodes |
| heredoc_start / heredoc_body | FIFO AST nodes | Expression-position heredoc start paired FIFO with raw heredoc_body extra tokens |
| Pinned corpus | 127 extracted bodies | 3 mono examples, 14 lmok rule packs, and 110 lmcode-cpp sample-suite programs |
# Run the complete tree-sitter-lmcode verification suite
tree-sitter generate
tree-sitter test --rebuild
python3 scripts/conformance.py
python3 scripts/negative.py
python3 scripts/incremental.py
python3 scripts/scanner-limits.py
python3 scripts/controls.py