| 9333 | }; |
| 9334 | |
| 9335 | class Arg : public ParserRefImpl<Arg> { |
| 9336 | public: |
| 9337 | using ParserRefImpl::ParserRefImpl; |
| 9338 | |
| 9339 | auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override { |
| 9340 | auto validationResult = validate(); |
| 9341 | if( !validationResult ) |
| 9342 | return InternalParseResult( validationResult ); |
| 9343 | |
| 9344 | auto remainingTokens = tokens; |
| 9345 | auto const &token = *remainingTokens; |
| 9346 | if( token.type != TokenType::Argument ) |
| 9347 | return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) ); |
| 9348 | |
| 9349 | assert( !m_ref->isFlag() ); |
| 9350 | auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() ); |
| 9351 | |
| 9352 | auto result = valueRef->setValue( remainingTokens->token ); |
| 9353 | if( !result ) |
| 9354 | return InternalParseResult( result ); |
| 9355 | else |
| 9356 | return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) ); |
| 9357 | } |
| 9358 | }; |
| 9359 | |
| 9360 | inline auto normaliseOpt( std::string const &optName ) -> std::string { |
| 9361 | #ifdef CATCH_PLATFORM_WINDOWS |
no outgoing calls
no test coverage detected