Skip to content

Commit

Permalink
Revert the no longer needed fix from f1086d2 while retaining the rele…
Browse files Browse the repository at this point in the history
…vant TEST_CASE(define_define_17)
  • Loading branch information
datadiode committed Aug 31, 2024
1 parent 5547385 commit 5e16ae7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1561,10 +1561,7 @@ namespace simplecpp {
rawtokens2.push_back(new Token(rawtok->str(), rawtok1->location));
rawtok = rawtok->next;
}
bool first = true;
if (valueToken && valueToken->str() == rawtok1->str())
first = false;
if (expand(&output2, rawtok1->location, rawtokens2.cfront(), macros, expandedmacros, first))
if (expand(&output2, rawtok1->location, rawtokens2.cfront(), macros, expandedmacros))
rawtok = rawtok1->next;
} else {
rawtok = expand(&output2, rawtok->location, rawtok, macros, expandedmacros);
Expand Down Expand Up @@ -1809,10 +1806,8 @@ namespace simplecpp {
return sameline(lpar,tok) ? tok : nullptr;
}

const Token * expand(TokenList * const output, const Location &loc, const Token * const nameTokInst, const MacroMap &macros, std::set<TokenString> expandedmacros, bool first=false) const {

if (!first)
expandedmacros.insert(nameTokInst->str());
const Token * expand(TokenList * const output, const Location &loc, const Token * const nameTokInst, const MacroMap &macros, std::set<TokenString> expandedmacros) const {
expandedmacros.insert(nameTokInst->str());

usageList.push_back(loc);

Expand Down

0 comments on commit 5e16ae7

Please sign in to comment.