The Parser type uses a fair bit of reflection and knowledge of the OptionSpec<>/OptionSpec<,> types to implement type safe parsing of values. Update the Option and/or OptionSpec types to handle the value parsing and reduce the reflection/complexity of the top level Parser type.
The top level parser will
- inspect the input and locate the correct parser; an option specific parser or an argument parser, removing the option name from front of the input if applicable
- pass the current parser state (minus the option name if applicable) to the located parser, which will return consume from input and return the updated state
- repeat until input is empty
The
Parsertype uses a fair bit of reflection and knowledge of theOptionSpec<>/OptionSpec<,>types to implement type safe parsing of values. Update theOptionand/orOptionSpectypes to handle the value parsing and reduce the reflection/complexity of the top levelParsertype.The top level parser will