diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-28 07:51:41 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-28 07:51:41 (GMT) |
commit | 4fbe0ad60921724faf6ba635df13983b3496f3e9 (patch) | |
tree | faabcb8bd596c15e438319457dd97930c52d6e91 | |
parent | 10c1495dc8984ec3b800c290f1c7448e75478da1 (diff) | |
download | Doxygen-4fbe0ad60921724faf6ba635df13983b3496f3e9.zip Doxygen-4fbe0ad60921724faf6ba635df13983b3496f3e9.tar.gz Doxygen-4fbe0ad60921724faf6ba635df13983b3496f3e9.tar.bz2 |
More improvement regarding \\ilinebr handling
- White space around \\ilinebr is not preserved in commentscan
- Cases where \n was unput in doctokenizer are now handled in the same
way for \\ilinebr
-rw-r--r-- | src/commentscan.l | 14 | ||||
-rw-r--r-- | src/doctokenizer.l | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 3d0ca69..763a2dd 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -163,7 +163,6 @@ struct DocCmdMap static const std::map< std::string, DocCmdMap > docCmdMap = { // command name handler function command spacing - { "ilinebr", { &handleLineBr, CommandSpacing::Inline }}, { "addindex", { &handleAddIndex, CommandSpacing::Invisible }}, { "addtogroup", { &handleAddToGroup, CommandSpacing::Invisible }}, { "anchor", { &handleAnchor, CommandSpacing::Invisible }}, @@ -646,6 +645,9 @@ RCSTAG "$"{ID}":"[^\n$]+"$" ); yyextra->inInternalDocs = FALSE; } +<Comment>{B}*"\\ilinebr"{B}* { // preserve spacing around \\ilinebr + addOutput(yyscanner,yytext); + } <Comment>{B}*{CMD}[a-z_A-Z]+"{"[a-zA-Z_,:0-9\. ]*"}"{B}* | <Comment>{B}*{CMD}[a-z_A-Z]+{B}* { // potentially interesting command // the {B}* in the front was added for bug620924 @@ -663,8 +665,8 @@ RCSTAG "$"{ID}":"[^\n$]+"$" else // options present { cmdName = fullMatch.left(idx).stripWhiteSpace().data()+1; // to remove {CMD} - QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace(); - optList = QCStringList::split(',',optStr); + QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace(); + optList = QCStringList::split(',',optStr); } auto it = docCmdMap.find(cmdName.data()); if (it!=docCmdMap.end()) // special action is required @@ -2538,12 +2540,6 @@ static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringLi return FALSE; } -static bool handleLineBr(yyscan_t yyscanner,const QCString &, const QCStringList &) -{ - addOutput(yyscanner,"\\ilinebr "); - return FALSE; -} - static bool handleStatic(yyscan_t yyscanner,const QCString &, const QCStringList &) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 51d234b..0b14613 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -955,6 +955,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_Title>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } <St_TitleN>"&"{ID}";" { /* symbol */ @@ -994,6 +995,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_TitleN>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } <St_TitleQ>"&"{ID}";" { /* symbol */ @@ -1024,6 +1026,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_TitleQ>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } <St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute @@ -1045,6 +1048,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_TitleV,St_TitleA>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } @@ -1077,6 +1081,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_Cite>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } <St_Cite>. { // any other character @@ -1107,6 +1112,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} return 0; } <St_Ref>"\\ilinebr" { + for (int i=yyleng-1;i>=0;i--) unput(yytext[i]); return 0; } <St_Ref>. { // any other character |