summaryrefslogtreecommitdiffstats
path: root/src/doctokenizer.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/doctokenizer.l')
-rw-r--r--src/doctokenizer.l51
1 files changed, 28 insertions, 23 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index d994340..a717d69 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -26,10 +26,10 @@
#include <ctype.h>
#include <stack>
+#include <string>
#include <qfile.h>
#include <qstring.h>
-#include <qregexp.h>
#include "doctokenizer.h"
#include "cmdmapper.h"
@@ -41,6 +41,7 @@
#include "doxygen.h"
#include "portable.h"
#include "cite.h"
+#include "regex.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -514,9 +515,11 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=yytext;
- static QRegExp re("[*+]");
- int listPos = text.findRev(re);
+ std::string text=yytext;
+ static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
+ reg::Match match;
+ reg::search(text,match,re);
+ size_t listPos = match.position();
g_token->isEnumList = FALSE;
g_token->id = -1;
g_token->indent = computeIndent(yytext,listPos);
@@ -530,13 +533,13 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
else
{
- QCString text=yytext;
- static QRegExp re("[1-9]");
- int digitPos = text.find(re);
- int dotPos = text.find('.',digitPos);
- g_token->isEnumList = TRUE;
- g_token->id = atoi(QCString(yytext).mid(digitPos,dotPos-digitPos));
- g_token->indent = computeIndent(yytext,digitPos);
+ std::string text=yytext;
+ static const reg::Ex re(R"(\d+)");
+ reg::Match match;
+ reg::search(text,match,re);
+ g_token->isEnumList = true;
+ g_token->id = std::stoul(match.str());
+ g_token->indent = computeIndent(yytext,match.position());
return TK_LISTITEM;
}
}
@@ -557,12 +560,14 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
- static QRegExp re("[*+]");
- int markPos = text.findRev(re);
+ std::string text=extractPartAfterNewLine(yytext).str();
+ static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
+ reg::Match match;
+ reg::search(text,match,re);
+ size_t markPos = match.position();
g_token->isEnumList = FALSE;
g_token->id = -1;
- g_token->indent = computeIndent(text,markPos);
+ g_token->indent = computeIndent(text.c_str(),markPos);
return TK_LISTITEM;
}
}
@@ -574,13 +579,13 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
- static QRegExp re("[1-9]");
- int digitPos = text.find(re);
- int dotPos = text.find('.',digitPos);
- g_token->isEnumList = TRUE;
- g_token->id = atoi(QCString(text).mid(digitPos,dotPos-digitPos));
- g_token->indent = computeIndent(text,digitPos);
+ std::string text=extractPartAfterNewLine(yytext).str();
+ static const reg::Ex re(R"(\d+)");
+ reg::Match match;
+ reg::search(text,match,re);
+ g_token->isEnumList = true;
+ g_token->id = std::stoul(match.str());
+ g_token->indent = computeIndent(text.c_str(),match.position());
return TK_LISTITEM;
}
}
@@ -809,7 +814,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
lineCount(yytext,yyleng);
}
-<St_Para>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
+<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
lineCount(yytext,yyleng);
if (g_insidePre)
{