Commit d30e806
committed
feat: add GrammarInterpreter and ImagePipe validation tests
- Add runtime interpreter for GrammarIR (runtime2/interpreter.rs)
- Executes grammar patterns directly without code generation
- Supports all pattern types: literals, char classes, sequences, choices,
optionals, repeats, lookaheads, SOI/EOI
- Handles atomic rules with text capture
- Proper whitespace/comment skipping between elements
- Add comprehensive ImagePipe grammar tests (45 tests)
- Grammar structure validation (metadata, builtins, rule count)
- Pattern structure tests for all 23 ImagePipe rules
- Terminal rule tests (identifier, integer, string_literal, etc.)
- Interpreter parsing tests for individual statements
- End-to-end parsing of vintage.imgpipe using actual grammar
- Fix whitespace handling bugs:
- Preserve position 0 for SOI matching
- Skip whitespace before first item in repeat patterns
Phase 4 of ZynPEG 2.0 plan validated against ImagePipe DSL.1 parent d9f7e0f commit d30e806
6 files changed
Lines changed: 1995 additions & 3632 deletions
File tree
- crates/zyn_peg
- generated
- src/runtime2
- tests
Binary file not shown.
0 commit comments