Commit 0df0aca
Add the type-erased arg-parser runtime kernel with property tests (#566)
ArgParserRuntime is the future core of the generated argument parser: a
pure, type-erased kernel (scan argv into an ordered event log; select
discriminated-union cases; validate against the schema shape) which will
be embedded verbatim into generated parser output and drive a thin typed
layer of converters and record assembly. It supports Leaf/Product/Sum
schemas: sums are the upcoming DU-alternative feature, selected
shape-first ("exactly one interpretation consumes every argument") with
globally-unique argument names.
Nothing consumes it yet; the generator cutover comes separately.
Tests include an executable reference semantics (expand every sum into
its complete alternatives; accept exactly one) and FsCheck properties:
- compositional selection == exhaustive alternative expansion, over
random schema trees and observed-sets fuzzed across valid/noisy/empty
regimes, with instrumented distribution assertions;
- scanning is lossless (unscan . scan = id) for arbitrary token lists;
- a trailing "--" appends exactly a Separator event;
- round trip: rendered command lines scan to exactly the intended
events, across =/space forms, case variation, negation, bare flags.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent aed0824 commit 0df0aca
4 files changed
Lines changed: 2226 additions & 0 deletions
File tree
- WoofWare.Myriad.Plugins.Test
- TestArgParser
- WoofWare.Myriad.Plugins
0 commit comments