diff options
author | hjk <qtc-committer@nokia.com> | 2009-10-30 11:15:11 (GMT) |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-10-30 11:15:11 (GMT) |
commit | 7c04935b278db196b3e67a6b501ec14d852acabd (patch) | |
tree | 2424c1a9c90757947cb13e67a4a61ad3473fdd7a /tools/linguist | |
parent | 1bed105d048531e3e260eff0ef2533d7cc8ba7fb (diff) | |
parent | 83fff2f970b9a7b41861336c7dca0eadbda28099 (diff) | |
download | Qt-7c04935b278db196b3e67a6b501ec14d852acabd.zip Qt-7c04935b278db196b3e67a6b501ec14d852acabd.tar.gz Qt-7c04935b278db196b3e67a6b501ec14d852acabd.tar.bz2 |
Merge commit 'mainline/4.6' into 4.6
Diffstat (limited to 'tools/linguist')
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 7a616e3..4d89156 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1896,28 +1896,29 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) prospectiveContext.clear(); } break; - case Tok_Comment: + case Tok_Comment: { if (!tor) goto case_default; - if (yyWord.startsWith(QLatin1Char(':'))) { - yyWord.remove(0, 1); + const QChar *ptr = yyWord.unicode(); + if (*ptr == QLatin1Char(':') && ptr[1].isSpace()) { + yyWord.remove(0, 2); extracomment += yyWord; extracomment.detach(); - } else if (yyWord.startsWith(QLatin1Char('='))) { - yyWord.remove(0, 1); + } else if (*ptr == QLatin1Char('=') && ptr[1].isSpace()) { + yyWord.remove(0, 2); msgid = yyWord.simplified(); msgid.detach(); - } else if (yyWord.startsWith(QLatin1Char('~'))) { - yyWord.remove(0, 1); + } else if (*ptr == QLatin1Char('~') && ptr[1].isSpace()) { + yyWord.remove(0, 2); text = yyWord.trimmed(); int k = text.indexOf(QLatin1Char(' ')); if (k > -1) extra.insert(text.left(k), text.mid(k + 1).trimmed()); text.clear(); - } else if (yyWord.startsWith(QLatin1Char('%'))) { - sourcetext.reserve(sourcetext.length() + yyWord.length()); + } else if (*ptr == QLatin1Char('%') && ptr[1].isSpace()) { + sourcetext.reserve(sourcetext.length() + yyWord.length() - 2); ushort *ptr = (ushort *)sourcetext.data() + sourcetext.length(); - int p = 1, c; + int p = 2, c; forever { if (p >= yyWord.length()) break; @@ -1977,6 +1978,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) } yyTok = getToken(); break; + } case Tok_Arrow: yyTok = getToken(); if (yyTok == Tok_tr || yyTok == Tok_trUtf8) |