diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-08-18 17:59:28 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-09-23 13:44:26 (GMT) |
commit | b17a8c5c1bc7d8c26f2bf35116de71d7b582751f (patch) | |
tree | 14bb12863dba9f96086453bc57edf8d03bc7e972 | |
parent | 2bc1550b3dfe05353c2cb72f9d980c67e68aceaf (diff) | |
download | Qt-b17a8c5c1bc7d8c26f2bf35116de71d7b582751f.zip Qt-b17a8c5c1bc7d8c26f2bf35116de71d7b582751f.tar.gz Qt-b17a8c5c1bc7d8c26f2bf35116de71d7b582751f.tar.bz2 |
when matching strings, skip also leading comments
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index c224e2f..b8f8451 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1174,16 +1174,18 @@ bool CppParser::match(uint t) bool CppParser::matchString(QString *s) { - bool matches = (yyTok == Tok_String); + bool matches = false; s->clear(); - while (yyTok == Tok_String) { + forever { + while (yyTok == Tok_Comment) + yyTok = getToken(); + if (yyTok != Tok_String) + return matches; + matches = true; *s += yyWord; s->detach(); - do { - yyTok = getToken(); - } while (yyTok == Tok_Comment); + yyTok = getToken(); } - return matches; } bool CppParser::matchEncoding(bool *utf8) |