What problem does it solve?
Provides concrete guidance and patterns to develop an LSP-quality, error-resilient parser for the Plank language, ensuring the parser never crashes and always represents all input (including malformed code) in the CST for downstream tooling and diagnostics.
Core Features & Use Cases
- Error resilience: Consume all input, wrap unexpected tokens in error nodes, emit diagnostics, and continue parsing to maximize recovered structure.
- CST-first representation: Design nodes and node-child relationships so semantics are inferable from the tree structure without ad-hoc token inspection.
- Practical parsing patterns: Use guard checks, iterative loops for variable-length constructs, precise expected-token tracking, and explicit node allocation/close lifecycle compatible with LSP and testing.
- Testing and tooling: Snapshot-style CST tests, dedicated error recovery tests, and conventions for statement/expression parsing modes to ensure predictable behavior.
Quick Start
Ask the parser-engineer skill to analyze frontend/parser/src/parser.rs and report parse errors, emitted diagnostics with expected-token sets, and a high-level summary of the produced CST structure.