Parser ambiguity and robustness inventory
The canonical parser is recursive descent in crates/vox-compiler/src/parser/descent. It is not the tree-sitter-vox grammar (highlighting / editor tooling may diverge).
Error taxonomy
Each ParseError carries a ParseErrorClass:
| Class | Typical cause |
|---|---|
expect_token | Parser::expect mismatch (wrong token at a committed point). |
top_level | Token cannot start a module-level declaration. |
declaration | pub / attribute / item head issues. |
expression / statement / type_expr | Reserved for finer-grained classification in inner parsers. |
other | Default for legacy call sites. |
Fixture corpus (reproducible)
| ID | File | Intent |
|---|---|---|
| INV-01 | examples/parser-inventory/top-level-garbage.vox | Invalid top-level → recovery; subsequent valid decls still parsed when possible. |
| INV-02 | examples/parser-inventory/nested-unclosed.vox | Unbalanced braces inside function → parser errors + recovery. |
| INV-03 | examples/parser-inventory/pub-bogus.vox | pub not followed by fn/type → declaration-class error. |
Automated no-panic corpus { crates/vox-compiler/tests/parser_corpus_no_panic.rs.