summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-06-09 00:34:04 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-06-09 00:34:04 (GMT)
commitb8c8c87587bcc0312f0efbb2028885adb8419fee (patch)
tree4857b4ff79acb48953c9a2a7c3a62c6dfeafdda3 /tools/linguist/lupdate
parent9410eb0630e0f3b80ffd335002efbd7ce532e826 (diff)
parent70283a0a87e46a8aa9d2e6296f4ed7c93cc230d6 (diff)
downloadQt-b8c8c87587bcc0312f0efbb2028885adb8419fee.zip
Qt-b8c8c87587bcc0312f0efbb2028885adb8419fee.tar.gz
Qt-b8c8c87587bcc0312f0efbb2028885adb8419fee.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: configure.exe tools/qdoc3/htmlgenerator.cpp tools/qdoc3/tree.cpp
Diffstat (limited to 'tools/linguist/lupdate')
-rw-r--r--tools/linguist/lupdate/cpp.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 42aa2f0..b9e8406 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -145,7 +145,6 @@ public:
const ParseResults *getResults() const { return results; }
void deleteResults() { delete results; }
-private:
struct SavedState {
QStringList namespaces;
QStack<int> namespaceDepths;
@@ -154,6 +153,7 @@ private:
QString pendingContext;
};
+private:
struct IfdefState {
IfdefState() {}
IfdefState(int _braceDepth, int _parenDepth) :
@@ -319,12 +319,27 @@ uint CppParser::getChar()
if (yyInPos >= yyInStr.size())
return EOF;
uint c = yyInStr[yyInPos++].unicode();
- if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') {
- ++yyCurLineNo;
- ++yyInPos;
- continue;
+ if (c == '\\' && yyInPos < yyInStr.size()) {
+ if (yyInStr[yyInPos].unicode() == '\n') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ continue;
+ }
+ if (yyInStr[yyInPos].unicode() == '\r') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ continue;
+ }
}
- if (c == '\n') {
+ if (c == '\r') {
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ c = '\n';
+ ++yyCurLineNo;
+ yyAtNewline = true;
+ } else if (c == '\n') {
++yyCurLineNo;
yyAtNewline = true;
} else if (c != ' ' && c != '\t' && c != '#') {