| 9021 | }; |
| 9022 | |
| 9023 | class Arg : public ParserRefImpl<Arg> { |
| 9024 | public: |
| 9025 | using ParserRefImpl::ParserRefImpl; |
| 9026 | |
| 9027 | auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override { |
| 9028 | auto validationResult = validate(); |
| 9029 | if( !validationResult ) |
| 9030 | return InternalParseResult( validationResult ); |
| 9031 | |
| 9032 | auto remainingTokens = tokens; |
| 9033 | auto const &token = *remainingTokens; |
| 9034 | if( token.type != TokenType::Argument ) |
| 9035 | return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) ); |
| 9036 | |
| 9037 | assert( !m_ref->isFlag() ); |
| 9038 | auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() ); |
| 9039 | |
| 9040 | auto result = valueRef->setValue( remainingTokens->token ); |
| 9041 | if( !result ) |
| 9042 | return InternalParseResult( result ); |
| 9043 | else |
| 9044 | return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) ); |
| 9045 | } |
| 9046 | }; |
| 9047 | |
| 9048 | inline auto normaliseOpt( std::string const &optName ) -> std::string { |
| 9049 | #ifdef CATCH_PLATFORM_WINDOWS |
no outgoing calls
no test coverage detected