diff options
Diffstat (limited to 'src/doctokenizer.l')
-rw-r--r-- | src/doctokenizer.l | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 0c167ca..9bafcab 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 @@ -513,9 +514,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); @@ -529,13 +532,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; } } @@ -556,12 +559,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; } } @@ -573,13 +578,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; } } @@ -808,7 +813,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) { |