ParserError shrinks from 40 to 24 bytes. A private Storage enum holds a
pointer to a StaticString hint, a digit-count hint formatted when read,
or a boxed String. The throw site is a ThrowSite: file pointer, UInt32
line, UInt8 length.
- Hints are StaticString, so the compiler rejects interpolation.
Computed hints use `init(dynamicHint:)`, which allocates.
- `parseNDigits` uses `init(expectedDigits:got:)` instead of
interpolating on every mismatch.
- `hint` is computed; assigning it boxes. A custom Mirror (public
`CustomReflectable` conformance) keeps the printed form.
- Behavior change: `file` names the throwing site. The `(#fileID)`
defaults named ParserErrors.swift, and the three `parseOneOf`
overloads' named ParseInput+Combinators.swift; the array form's
"none of the options match" now names the calling file.
- `NoForwardProgress` stores a `ThrowSite` too. Public API addition:
`CustomReflectable` conformance, which keeps `file` and `line` in
its Mirror.
- ThrowSite and LiteralHint are @unchecked Sendable: they point at
immortal literals. Both join the unsafe-seams list in ParseInput.swift.
Untyped throws still box every error, so the size buys little here. It
is for typed throws, next, which return the error in registers.
* [CI] Adopt GitHub Actions
# Motivation
We want to adopt GitHub actions in all of our Swift repositories to replace our current Jenkins CI.
# Modification
This PR adopts the reusable workflows from NIO and the swiftlang organization to ensure soundness and test coverage. Additionally, this PR enables a sematic label check and adds a `release.yml` to make releasing this package easy.
# Result
Modern CI and release flow.
Resolves#522
Some command names were misleading, they should be better now. Also removed a redundant initialiser.
PartialCommandStream -> SynchronizedCommand
CommandStream -> CommandStreamPart
Motivation:
CATENATE functionality is convenient for low-power client usage, as it
allows clients to stitch together new messages out of the parts of older
ones without needing to reupload (or indeed redownload) that content.
Modifications:
- Extend CommandStream to support CATENATE.
- Extend serializer and parser to work with new definitions.
Result:
CATENATE is parseable.
* Use encoding options specific to the transport direction.
* Add description to precondition failure.
* Make properties on EncodingOptions public.
* Rename files.
* Change APPEND to use CommandEncodingOptions.