paulandClaude Sonnet 5.5 61ea7166e3 Support some, ok and err wrappers and untyped function inputs
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>
2026-10-18 14:54:48 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00
2026-09-23 00:36:22 -04:00

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.

S
Description
No description provided
Readme
359 KiB
1 Watchers 0 Forks
Languages
C 96.5%
JavaScript 1.3%
Rust 1.2%
C++ 0.8%
Tree-sitter Query 0.1%