Skip to content

Commit

Permalink
Use new findsimplematch API for simple patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjfox committed Oct 28, 2011
1 parent bab7402 commit ef8f49b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2286,13 +2286,13 @@ bool Tokenizer::tokenize(std::istream &code,
continue;
//find the two needed semicolons inside the 'for'
const Token *firstsemicolon = Token::findmatch(tok->next(), ";", tok->next()->link());
const Token *firstsemicolon = Token::findsimplematch(tok->next(), ";", tok->next()->link());
if (!firstsemicolon)
continue;
const Token *secondsemicolon = Token::findmatch(firstsemicolon->next(), ";", tok->next()->link());
const Token *secondsemicolon = Token::findsimplematch(firstsemicolon->next(), ";", tok->next()->link());
if (!secondsemicolon)
continue;
if (Token::findmatch(secondsemicolon->next(), ";", tok->next()->link()))
if (Token::findsimplematch(secondsemicolon->next(), ";", tok->next()->link()))
continue; //no more than two semicolons!
if (!tok->next()->link()->next())
continue; //there should be always something after 'for (...)'
Expand Down

0 comments on commit ef8f49b

Please sign in to comment.