diff options
Diffstat (limited to 'tools/linguist/lupdate/cpp.cpp')
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index b3e7e84f80..609bd3dff9 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1761,7 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n"; + yyMsg() << "//% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_trUtf8); line = yyLineNo; yyTok = getToken(); @@ -1858,6 +1858,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) gotctx: recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } + sourcetext.clear(); // Will have warned about that already extracomment.clear(); msgid.clear(); extra.clear(); @@ -1867,7 +1868,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n"; + yyMsg() << "//% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_translateUtf8); line = yyLineNo; yyTok = getToken(); @@ -1913,6 +1914,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) } recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } + sourcetext.clear(); // Will have warned about that already extracomment.clear(); msgid.clear(); extra.clear(); @@ -2079,9 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) case Tok_Semicolon: prospectiveContext.clear(); prefix.clear(); - extracomment.clear(); - msgid.clear(); - extra.clear(); + if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) { + yyMsg() << "Discarding unconsumed meta data\n"; + sourcetext.clear(); + extracomment.clear(); + msgid.clear(); + extra.clear(); + } yyTokColonSeen = false; yyTok = getToken(); break; |