| 7227 | }; |
| 7228 | |
| 7229 | class Arg : public ParserRefImpl<Arg> { |
| 7230 | public: |
| 7231 | using ParserRefImpl::ParserRefImpl; |
| 7232 | |
| 7233 | auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override { |
| 7234 | auto validationResult = validate(); |
| 7235 | if( !validationResult ) |
| 7236 | return InternalParseResult( validationResult ); |
| 7237 | |
| 7238 | auto remainingTokens = tokens; |
| 7239 | auto const &token = *remainingTokens; |
| 7240 | if( token.type != TokenType::Argument ) |
| 7241 | return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) ); |
| 7242 | |
| 7243 | assert( !m_ref->isFlag() ); |
| 7244 | auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() ); |
| 7245 | |
| 7246 | auto result = valueRef->setValue( remainingTokens->token ); |
| 7247 | if( !result ) |
| 7248 | return InternalParseResult( result ); |
| 7249 | else |
| 7250 | return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) ); |
| 7251 | } |
| 7252 | }; |
| 7253 | |
| 7254 | inline auto normaliseOpt( std::string const &optName ) -> std::string { |
| 7255 | #ifdef CATCH_PLATFORM_WINDOWS |
no outgoing calls
no test coverage detected