@@ -2006,7 +2006,7 @@ namespace simplecpp {
20062006 if (output2.cfront () != output2.cback () && macro2tok->str () == this ->name ())
20072007 break ;
20082008 const MacroMap::const_iterator macro = macros.find (macro2tok->str ());
2009- if (macro == macros.end () || !macro->second .functionLike () || macro2tok->isExpandedFrom (¯o->second ))
2009+ if (macro == macros.end () || !macro->second .functionLike () || macro2tok->isInHideSet (¯o->second ))
20102010 break ;
20112011 TokenList rawtokens2 (inputFiles);
20122012 const Location loc (macro2tok->location );
@@ -2110,15 +2110,15 @@ namespace simplecpp {
21102110 * @param str the token text
21112111 * @param loc the location
21122112 * @param replaced Token::macro is set to the name of this macro
2113- * @param expandedFromToken if not null, the new token copies its "expanded from" set and
2114- * its whitespace, and this macro is added to the set
2113+ * @param expandedFromToken if not null, the new token copies its hide set and
2114+ * its whitespace, and this macro is added to the hide set
21152115 */
21162116 Token *newMacroToken (const TokenString &str, const Location &loc, bool replaced, const Token *expandedFromToken=nullptr ) const {
21172117 auto *tok = new Token (str,loc);
21182118 if (replaced)
21192119 tok->macro = nameTokDef->str ();
21202120 if (expandedFromToken) {
2121- tok->setExpandedFrom (expandedFromToken, this );
2121+ tok->setHideSet (expandedFromToken, this );
21222122 tok->whitespaceahead = expandedFromToken->whitespaceahead ;
21232123 }
21242124 return tok;
@@ -2508,7 +2508,7 @@ namespace simplecpp {
25082508 const MacroMap::const_iterator it = macros.find (temp.cback ()->str ());
25092509 if (it == macros.end () || expandedmacros.find (temp.cback ()->str ()) != expandedmacros.end ())
25102510 return nullptr ;
2511- if (!it->second .functionLike () || temp.cback ()->isExpandedFrom (&it->second ))
2511+ if (!it->second .functionLike () || temp.cback ()->isInHideSet (&it->second ))
25122512 return nullptr ;
25132513 return &it->second ;
25142514 }
@@ -2604,7 +2604,7 @@ namespace simplecpp {
26042604
26052605 output.push_back (newMacroToken (tok->str (), loc, true , tok));
26062606 if (it != macros.end ())
2607- output.back ()->markExpandedFrom (&it->second );
2607+ output.back ()->addToHideSet (&it->second );
26082608 return tok->next ;
26092609 }
26102610
@@ -2680,7 +2680,7 @@ namespace simplecpp {
26802680 const Token * const argEnd = parametertokens[argnr + 1U ];
26812681 for (const Token *partok = parametertokens[argnr]->next ; partok != argEnd;) {
26822682 const MacroMap::const_iterator it = macros.find (partok->str ());
2683- if (it != macros.end () && !partok->isExpandedFrom (&it->second ) && (partok->str () == name () || expandedmacros.find (partok->str ()) == expandedmacros.end ())) {
2683+ if (it != macros.end () && !partok->isInHideSet (&it->second ) && (partok->str () == name () || expandedmacros.find (partok->str ()) == expandedmacros.end ())) {
26842684 std::set<TokenString> expandedmacros2 (expandedmacros); // temporary amnesia to allow reexpansion of currently expanding macros during argument evaluation
26852685 expandedmacros2.erase (name ());
26862686 TokenList temp (files);
0 commit comments