summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-02-09 18:44:06 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-02-09 18:44:06 (GMT)
commit89859e4dc667989bf41ad340df9b553457ae46db (patch)
treecfe2345090715c5e49b53c2b20660181681a7542 /tools/qdoc3
parentc509c5e5de3557c31adc78744e212b8ed37d5e1f (diff)
downloadQt-89859e4dc667989bf41ad340df9b553457ae46db.zip
Qt-89859e4dc667989bf41ad340df9b553457ae46db.tar.gz
Qt-89859e4dc667989bf41ad340df9b553457ae46db.tar.bz2
qdoc: Made a temporary fix for comment highlighting.
Reviewed-by: Trust Me
Diffstat (limited to 'tools/qdoc3')
-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;