summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/cppcodemarker.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-11 01:30:27 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-11 01:30:27 (GMT)
commita7f0c36effc38a8d6525538afe1fdcd88b39d244 (patch)
treeb2bf6ad19d15ed1f393b9aff81ed2ee2b77e2b01 /tools/qdoc3/cppcodemarker.cpp
parentdbfe5f81e300de3a43311197826f23ff031b4b23 (diff)
parentc072fa8fdd0cebcaff9062e07d4623bbd7aded3c (diff)
downloadQt-a7f0c36effc38a8d6525538afe1fdcd88b39d244.zip
Qt-a7f0c36effc38a8d6525538afe1fdcd88b39d244.tar.gz
Qt-a7f0c36effc38a8d6525538afe1fdcd88b39d244.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: qdoc: Added a build rule for the documentation - disabled by default. Doc: Added the qdoc manual to the repository for future maintenance. qdoc3: Fixed bug in creation of qt.pageindex. qdoc3: Added capability to create qt.pageindex. Incorrect property setter generated by dumpcpp for Microsoft Word 2007. Cocoa: Implement our own NSApplication subclass Cocoa: Menu in menubar stays highlighted qdoc: Made a temporary fix for comment highlighting. Doc: Tidied up the class layout and removed an unnecessary image. Doc/qdoc: Use Chinese titles; canonicalize titles with non-ASCII chars. Doc/qdoc: Converted encoding of ISO-8859-1 docs to UTF-8. Output UTF-8. qdoc: Removed debugging code. Doc: Updated the configuration file for the Simplified Chinese docs. qdoc: Standardized encoding names and updated the Chinese config files. Doc: Added Simplified Chinese documents and build rules for them. qdoc: Added support for different source and output character encodings. Doc: Synchronize configuration files for easier maintenance.
Diffstat (limited to 'tools/qdoc3/cppcodemarker.cpp')
-rw-r--r--tools/qdoc3/cppcodemarker.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index 2df7133..571fd75 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -881,8 +881,7 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode,
static QRegExp globalX("[\n{()=] *([a-zA-Z_][a-zA-Z_0-9]*)[ \n]*\\(");
static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)");
multiLineComment.setMinimal(true);
- static QRegExp singleLineCommentLine("(?:^|\n)(?:[^&]|&(?!quot;)|&quot;(?:[^&\\\\]|&(?!quot;)|\\\\&quot;|\\\\(?!&quot;))*&quot;)*//(?!!)[^!\n]*");
- static QRegExp singleLineComment("//(?!!)[^!\n]*");
+ static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*");
static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define"
"|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)");
static QRegExp literals("&quot;(?:[^\\\\&]|\\\\[^\n]|&(?!quot;))*&quot;"
@@ -1057,8 +1056,7 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode,
int mlpos;
int slpos;
int len;
- int sllpos = singleLineCommentLine.indexIn(result, pos);
- slpos = sllpos == -1 ? -1 : singleLineComment.indexIn(result, sllpos);
+ slpos = singleLineComment.indexIn(result, pos);
mlpos = multiLineComment.indexIn(result, pos);
if (slpos == -1 && mlpos == -1)
@@ -1069,13 +1067,13 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode,
len = multiLineComment.matchedLength();
}
else if (mlpos == -1) {
- pos = slpos;
- len = singleLineComment.matchedLength();
+ pos = slpos + 1;
+ len = singleLineComment.matchedLength() - 1;
}
else {
if (slpos < mlpos) {
- pos = slpos;
- len = singleLineComment.matchedLength();
+ pos = slpos + 1;
+ len = singleLineComment.matchedLength() - 1;
}
else {
pos = mlpos;