File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8830,17 +8830,17 @@ void Tokenizer::findGarbageCode() const
88308830 continue ;
88318831 // count number of semicolons
88328832 int semicolons = 0 , colons = 0 ;
8833- const Token* const startTok = tok;
8834- tok = tok->linkAt (1 )->previous (); // find ")" of the for-loop
8835- // walk backwards until we find the beginning (startTok) of the for() again
8836- for (; tok != startTok; tok = tok->previous ()) {
8833+ const Token* const endTok = tok->linkAt (1 );
8834+ for (tok = tok->tokAt (2 ); tok != endTok; tok = tok->next ()) {
8835+ if (const Token* lam = findLambdaEndTokenWithoutAST (tok)) {
8836+ tok = lam;
8837+ continue ;
8838+ }
88378839 if (tok->str () == " ;" ) { // do the counting
88388840 semicolons++;
88398841 } else if (tok->str () == " :" ) {
8840- if (tok->strAt (-1 ) == " ," )
8841- syntaxError (tok);
88428842 colons++;
8843- } else if (tok->str () == " ) " ) { // skip pairs of ( )
8843+ } else if (tok->str () == " ( " ) { // skip pairs of ( )
88448844 tok = tok->link ();
88458845 }
88468846 }
You can’t perform that action at this time.
0 commit comments