MCPcopy Create free account
hub / github.com/apache/trafficserver / parse

Method parse

lib/catch2/catch.hpp:9346–9364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected