○
Planned This feature is planned but not yet implemented.
DEFERRED: literate / compiler annotations on TYPE positions (same bucket as 210_039)
Failure Output
Showing last 10 of 54 lines
--> tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_040_literate_annotations/input.kz:43:1
|
43 | | star void[*]
| ^
error[KORU010]: stray continuation line without Koru construct
--> tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_040_literate_annotations/input.kz:44:1
|
44 | | whitespace void[\s+]
| ^ 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)
] event token {}
| number u64[\d+]
| string []const u8["[^"]*"]
| identifier []const u8[[a-zA-Z_][a-zA-Z0-9_]*]
| lparen void[(]
| rparen void[)]
| plus void[+]
| star void[*]
| whitespace void[\s+]