DEFERRED: literate / compiler annotations on TYPE positions (same bucket as 210_039)
Code
// TEST: Literate Annotations
// STATUS: ASPIRATIONAL
//
// Annotation blocks as micro-documents: markdown prose + directives.
// Parser extracts `-` prefixed lines as directives, ignores prose.
//
// This brings literate programming to metadata - the annotation
// explains AND instructs in one place.
~[
# Token Grammar
Defines a lexer for simple arithmetic expressions. Each branch
represents a token type with its regex pattern embedded in the
phantom type annotation.
- derive(parser)
## Generated Events
The parser transform will generate:
- `token.parse` - stream -> token branch
- `token.serialize` - token -> bytes
## Performance
- optimize(level: 3)
- inline
## Whitespace
We skip whitespace tokens rather than emitting them.
This keeps the token stream clean for the parser.
- whitespace(skip)
] tor token {}
| number u64[\d+]
| string string["[^"]*"]
| identifier string[[a-zA-Z_][a-zA-Z0-9_]*]
| lparen void[(]
| rparen void[)]
| plus void[+]
| star void[*]
| whitespace void[\s+]
Test Configuration
Awaiting ruling:
The same deferred call as 210_039 — annotations on type positions — asked here by regex-in-brackets on branch types. This test embeds patterns in `[]` on branch types (`| number u64[\d+]`, `| string []const u8["[^"]*"]`) as a literate-annotations experiment. Not phantom state. Its previous green was accidental and worth knowing before ruling: the `token` event is declared but never emitted (`main` is empty), so the bogus `[regex]` type strings were swallowed and never reached Zig. KORU033 now catches `u64[\d+]` at parse and offers the nonsensical-here hint "write u64<\d+>". So nothing here ever exercised working behaviour — only that the parser tolerated aspirational syntax. Answer 210_039 and this resolves with it: annotations on type positions either get proper `[]` extraction into a separate AST field, or the surface goes and types stay bare. Blocks: this test only. It is the second witness, not a second question.