MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / parse

Method parse

extern/Catch2/catch.hpp:9344–9362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9342 using ParserRefImpl::ParserRefImpl;
9343
9344 auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
9345 auto validationResult = validate();
9346 if( !validationResult )
9347 return InternalParseResult( validationResult );
9348
9349 auto remainingTokens = tokens;
9350 auto const &token = *remainingTokens;
9351 if( token.type != TokenType::Argument )
9352 return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
9353
9354 assert( !m_ref->isFlag() );
9355 auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
9356
9357 auto result = valueRef->setValue( remainingTokens->token );
9358 if( !result )
9359 return InternalParseResult( result );
9360 else
9361 return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
9362 }
9363 };
9364
9365 inline auto normaliseOpt( std::string const &optName ) -> std::string {

Callers 4

parseMethod · 0.45
ConfigMethod · 0.45
applyCommandLineMethod · 0.45
parseTestSpecFunction · 0.45

Calls 4

ParseStateClass · 0.85
isFlagMethod · 0.45
getMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected