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 31, 2024
1 parent c66b202 commit 9d59cec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions include/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace detail {
void loadBuffer() {
m_tokenBuffer.resize( 0 );

// Note: not skiping empty strings
// Note: not skipping empty strings

if( it != itEnd ) {
auto const &next = *it;
Expand Down Expand Up @@ -979,9 +979,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 +1004,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
8 changes: 3 additions & 5 deletions single_include/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ namespace detail {
void loadBuffer() {
m_tokenBuffer.resize( 0 );

// Note: not skiping empty strings
// Note: not skipping empty strings

if( it != itEnd ) {
auto const &next = *it;
Expand Down Expand Up @@ -1319,9 +1319,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 +1344,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 9d59cec

Please sign in to comment.