Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Amended merging upstream/master into subcommand
Browse files Browse the repository at this point in the history
Amended #c66b20247858
  • Loading branch information
trueqbit committed Jan 29, 2024
1 parent c66b202 commit 699a6f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions include/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ namespace detail {
void loadBuffer() {
m_tokenBuffer.resize( 0 );

// Note: not skiping empty strings
// Note: not skipping empty strings
while (it != itEnd && it->empty())
++it;

if( it != itEnd ) {
auto const &next = *it;
Expand Down Expand Up @@ -979,9 +981,6 @@ namespace detail {
}
}

struct ParserInfo {
ParserBase const* parser = nullptr;
};
const size_t totalParsers = m_options.size() + m_args.size();
assert( totalParsers < 512 );
// ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
Expand All @@ -1007,7 +1006,8 @@ namespace detail {
while( result.value().remainingTokens() ) {
bool tokenParsed = false;

for (auto& parser : parsers) {
for (size_t i = 0; i < totalParsers; ++i) {
ParserBase const* parser = parsers[i];
if( parser->canParse() ) {
result = parser->internalParse(exeName, result.value().remainingTokens());
if (!result)
Expand Down
10 changes: 5 additions & 5 deletions single_include/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ namespace detail {
void loadBuffer() {
m_tokenBuffer.resize( 0 );

// Note: not skiping empty strings
// Note: not skipping empty strings
while (it != itEnd && it->empty())
++it;

if( it != itEnd ) {
auto const &next = *it;
Expand Down Expand Up @@ -1319,9 +1321,6 @@ namespace detail {
}
}

struct ParserInfo {
ParserBase const* parser = nullptr;
};
const size_t totalParsers = m_options.size() + m_args.size();
assert( totalParsers < 512 );
// ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
Expand All @@ -1347,7 +1346,8 @@ namespace detail {
while( result.value().remainingTokens() ) {
bool tokenParsed = false;

for (auto& parser : parsers) {
for (size_t i = 0; i < totalParsers; ++i) {
ParserBase const* parser = parsers[i];
if( parser->canParse() ) {
result = parser->internalParse(exeName, result.value().remainingTokens());
if (!result)
Expand Down

0 comments on commit 699a6f1

Please sign in to comment.