summaryrefslogtreecommitdiffstats
path: root/src/commentscan.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-01-07 20:51:07 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-01-07 20:51:07 (GMT)
commitc61d8701470352385bcf5720ee516ba95c4393c8 (patch)
tree498d67f3c418e7b9da5b07e1f5b6f67faa2b914f /src/commentscan.l
parentc581ea17bac7dd4ebba1ca53a55ef592f96e0117 (diff)
downloadDoxygen-c61d8701470352385bcf5720ee516ba95c4393c8.zip
Doxygen-c61d8701470352385bcf5720ee516ba95c4393c8.tar.gz
Doxygen-c61d8701470352385bcf5720ee516ba95c4393c8.tar.bz2
issue #6734 parsing performance worsened
Diffstat (limited to 'src/commentscan.l')
-rw-r--r--src/commentscan.l48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/commentscan.l b/src/commentscan.l
index 235cd7c..f9cc3b1 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -3074,6 +3074,33 @@ static void checkFormula()
//----------------------------------------------------------------------------
+QCString preprocessCommentBlock(const QCString &comment,
+ const QCString &fileName,
+ int lineNr)
+{
+ if (!comment.isEmpty() && Doxygen::markdownSupport)
+ {
+ QCString result = processMarkdown(fileName,lineNr,0,comment);
+ const char *p = result.data();
+ if (p)
+ {
+ while (*p==' ') p++; // skip over spaces
+ while (*p=='\n') p++; // skip over newlines
+ if (qstrncmp(p,"<br>",4)==0) p+=4; // skip over <br>
+ }
+ if (p>result.data())
+ {
+ // strip part of the input
+ result = result.mid(p-result.data());
+ }
+ return result;
+ }
+ else
+ {
+ return comment;
+ }
+}
+
bool parseCommentBlock(/* in */ ParserInterface *parser,
/* in */ Entry *curEntry,
/* in */ const QCString &comment,
@@ -3096,26 +3123,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
langParser = parser;
current = curEntry;
if (comment.isEmpty()) return FALSE; // avoid empty strings
- if (Doxygen::markdownSupport)
- {
- inputString = processMarkdown(fileName,lineNr,NULL,comment);
- const char *p = inputString.data();
- if (p)
- {
- while (*p==' ') p++; // skip over spaces
- while (*p=='\n') p++; // skip over newlines
- if (qstrncmp(p,"<br>",4)==0) p+=4; // skip over <br>
- }
- if (p>inputString.data())
- {
- // strip part of the input
- inputString = inputString.mid(p-inputString.data());
- }
- }
- else
- {
- inputString = comment;
- }
+ inputString = comment;
inputString.append(" ");
inputPosition = position;
yyLineNr = lineNr;