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

Commit 9d59cec

Browse files
committed
Amended merging upstream/master into subcommand
Amended #c66b20247858
1 parent c66b202 commit 9d59cec

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

include/clara.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace detail {
116116
void loadBuffer() {
117117
m_tokenBuffer.resize( 0 );
118118

119-
// Note: not skiping empty strings
119+
// Note: not skipping empty strings
120120

121121
if( it != itEnd ) {
122122
auto const &next = *it;
@@ -979,9 +979,6 @@ namespace detail {
979979
}
980980
}
981981

982-
struct ParserInfo {
983-
ParserBase const* parser = nullptr;
984-
};
985982
const size_t totalParsers = m_options.size() + m_args.size();
986983
assert( totalParsers < 512 );
987984
// ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
@@ -1007,7 +1004,8 @@ namespace detail {
10071004
while( result.value().remainingTokens() ) {
10081005
bool tokenParsed = false;
10091006

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

single_include/clara.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ namespace detail {
456456
void loadBuffer() {
457457
m_tokenBuffer.resize( 0 );
458458

459-
// Note: not skiping empty strings
459+
// Note: not skipping empty strings
460460

461461
if( it != itEnd ) {
462462
auto const &next = *it;
@@ -1319,9 +1319,6 @@ namespace detail {
13191319
}
13201320
}
13211321

1322-
struct ParserInfo {
1323-
ParserBase const* parser = nullptr;
1324-
};
13251322
const size_t totalParsers = m_options.size() + m_args.size();
13261323
assert( totalParsers < 512 );
13271324
// ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
@@ -1347,7 +1344,8 @@ namespace detail {
13471344
while( result.value().remainingTokens() ) {
13481345
bool tokenParsed = false;
13491346

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

0 commit comments

Comments
 (0)