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
ComponentVersion / KindRole
tree-sitter-cli0.27.1Pinned generator version producing committed src/parser.c, grammar.json, and node-types.json
src/parser.c + src/scanner.cC99 parser sourcesZero-Node native parser and external scanner for FIFO heredocs, qw/qi/qf, and splices
function_declarationAST nodeCovers @annotation fn name(params) -> ret implements Interface { ... }
return_assignmentAST nodeAssignment-only $return, $return.name, and $return[expr] target nodes
heredoc_start / heredoc_bodyFIFO AST nodesExpression-position heredoc start paired FIFO with raw heredoc_body extra tokens
Pinned corpus127 extracted bodies3 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

Documentation pages

Source repository and releases