Track the LScript changes since the grammar was first written: - some, ok and err are reserved prefix operators and wrapper patterns; the old |.some/|.ok/|.err forms and postfix/prefix ! are rejected - function literal inputs may omit their type annotation, and tuple components may omit theirs; an empty typed tuple pattern is now just the unit pattern - migrate fixtures, corpus, queries, CST contract and Rust tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tree-sitter-lscript
Tree-sitter grammar and editor queries for LScript.
This package provides a lossless, error-tolerant concrete syntax tree for LScript editors and source tools. Syntax fixtures and tests are included here.
The public named-node and field contract is documented in docs/cst.md.
Development
Tree-sitter 0.27 and Node.js are required.
npm install
npm run generate
npm test
npm run test:fixtures
npm run test:queries
cargo test
test:fixtures requires every syntax-valid fixture to parse without an ERROR
or MISSING node. It also checks syntax-invalid fixtures and fails if a new one
is accepted without recovery. Three exceptions are listed explicitly by the
script: the adjacency-only =- and != lexer errors, and recovery after a
repeated result operator. These need lexical or recovery handling rather than
a looser grammar rule.
The future-reserved word context is not yet emitted as a Tree-sitter keyword
because it has no grammar production. It should move into lexical handling with
the two adjacency checks above.
Generated parser sources under src/ are committed so consumers do not need
Node.js or the Tree-sitter CLI.