What problem does it solve?
Writing Lezer grammars involves tricky concepts like token precedence, shift/reduce conflicts, and tree traversal patterns. This Skill provides a complete reference and workflow for creating, compiling, and integrating .grammar files in the Liftosaur codebase without trial-and-error debugging.
Core Features & Use Cases
- Grammar Authoring: Full Lezer syntax reference covering rules, tokens, precedence, @skip, @specialize, external tokens, and dialects.
- Build & Integration: Commands to compile .grammar files with lezer-generator, plus patterns for evaluators, NodeName enums, and error handling with line/offset info.
- CodeMirror & Highlighting: Instructions for LRLanguage definitions, styleTags mappings, HTML highlighting via highlightTree, and nested parsing with parseMixed.
- Use Case: You need to add a new workout notation to the planner. Use this Skill to write the grammar rules, regenerate the parser with npm run grammar:planner, update the PlannerNodeName enum, and wire up syntax highlighting.
Quick Start
Write a Lezer grammar for parsing workout notes with dates and exercise names, then show me how to compile it and traverse the parse tree.