Fixed issue with different result types in Clara

This commit is contained in:
Phil Nash 2017-06-13 08:29:56 +01:00
parent c41a45e79c
commit e62b3beef4

View File

@ -870,16 +870,16 @@ namespace detail {
using ParserRefImpl::ParserRefImpl;
auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
auto result = validate();
if (!result)
return InternalParseResult(result);
auto validationResult = validate();
if (!validationResult)
return InternalParseResult(validationResult);
auto remainingTokens = tokens;
auto const &token = *remainingTokens;
if (token.type != TokenType::Argument)
return InternalParseResult::ok(ParseState(ParseResultType::NoMatch, remainingTokens));
result = m_ref->setValue(remainingTokens->token);
auto result = m_ref->setValue(remainingTokens->token);
if (!result)
return InternalParseResult(result);
else