@@ -3374,7 +3374,6 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
33743374 // AlwaysFalse => drop all code in #if and #else
33753375 enum IfState : std::uint8_t { True, ElseIsTrue, AlwaysFalse };
33763376 std::stack<int > ifstates;
3377- std::stack<const Token *> iftokens;
33783377 ifstates.push (True);
33793378
33803379 std::stack<const Token *> includetokenstack;
@@ -3700,24 +3699,15 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
37003699 ifstates.push (AlwaysFalse);
37013700 else
37023701 ifstates.push (conditionIsTrue ? True : ElseIsTrue);
3703- iftokens.push (rawtok);
37043702 } else if (ifstates.top () == True) {
37053703 ifstates.top () = AlwaysFalse;
3706- iftokens.top ()->nextcond = rawtok;
3707- iftokens.top () = rawtok;
37083704 } else if (ifstates.top () == ElseIsTrue && conditionIsTrue) {
37093705 ifstates.top () = True;
3710- iftokens.top ()->nextcond = rawtok;
3711- iftokens.top () = rawtok;
37123706 }
37133707 } else if (rawtok->str () == ELSE) {
37143708 ifstates.top () = (ifstates.top () == ElseIsTrue) ? True : AlwaysFalse;
3715- iftokens.top ()->nextcond = rawtok;
3716- iftokens.top () = rawtok;
37173709 } else if (rawtok->str () == ENDIF) {
37183710 ifstates.pop ();
3719- iftokens.top ()->nextcond = rawtok;
3720- iftokens.pop ();
37213711 } else if (rawtok->str () == UNDEF) {
37223712 if (ifstates.top () == True) {
37233713 const Token *tok = rawtok->next ;
@@ -3729,10 +3719,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
37293719 } else if (ifstates.top () == True && rawtok->str () == PRAGMA && rawtok->next && rawtok->next ->str () == ONCE && sameline (rawtok,rawtok->next )) {
37303720 pragmaOnce.insert (rawtok->location .file ());
37313721 }
3732- if (ifstates.top () != True && rawtok->nextcond )
3733- rawtok = rawtok->nextcond ->previous ;
3734- else
3735- rawtok = gotoNextLine (rawtok);
3722+ rawtok = gotoNextLine (rawtok);
37363723 continue ;
37373724 }
37383725
0 commit comments