The reader grammar defines whitespace/comments, identifiers, booleans, characters, strings, numeric tokens, lists, vectors, bytevectors, and quotation prefixes.
Current guarantees
- Integer:
-?(0|[1-9][0-9]*); rational: integer numerator over positive canonical denominator; real requires fraction or exponent. - Dotted-list placement, escape spelling, byte range, and delimiter closure are checked before normalization.
- Source spans use the reader input identity and deterministic positions.
Pinned token grammar
| Token | Accepted shape | Rejected boundary |
|---|---|---|
| integer | -?(0|[1-9][0-9]*) | leading zero, radix/exactness prefix |
| rational | <integer>/[1-9][0-9]*; reduced after read | zero/negative denominator spelling, leading-zero denominator |
| real | decimal with fraction and/or exponent | bare integer ambiguity, non-finite literal |
| character | #\<scalar> or pinned named form | invalid scalar or incomplete escape |
| bytevector | #u8(<byte> ...) | element outside 0..255 |
Boundaries
- Reader extensions not listed in the profile fail loudly.