How-to guides
Extend syntax without leaking parser helpers
Complete a task or diagnose a specific problem.
1. Add the syntax production to the PEG grammar, then normalize it into an explicit runtime token. Keep whitespace and parser helper nodes out of the interpreter contract.
2. Implement the token’s state transition with explicit handling of frames, heap references, return, and break where relevant.
3. Exercise a valid program and a malformed or invalid-state case. Update diagnostics and tokenizer rules where the new syntax affects the editor.