MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / parse

Method parse

unittests/catch.hpp:6122–6140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6120 using ParserRefImpl::ParserRefImpl;
6121
6122 auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
6123 auto validationResult = validate();
6124 if( !validationResult )
6125 return InternalParseResult( validationResult );
6126
6127 auto remainingTokens = tokens;
6128 auto const &token = *remainingTokens;
6129 if( token.type != TokenType::Argument )
6130 return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
6131
6132 assert( !m_ref->isFlag() );
6133 auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
6134
6135 auto result = valueRef->setValue( remainingTokens->token );
6136 if( !result )
6137 return InternalParseResult( result );
6138 else
6139 return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
6140 }
6141 };
6142
6143 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