From 93a6f04ac6f9df7c66b704b24383e3d239fc7c17 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 9 Jan 2020 15:50:03 +0100 Subject: Consistency `\*only` and `\end*only` commands Not all possibilities in respect of `\*only` and `\end*only` commands were present which could lead to messages like: ``` .../aa.h:4: warning: reached end of comment while inside a \rtfonly block; check for missing \endrtfonly tag! ../.aa.h:4: warning: rtfonly section ended without end marker .../aa.h:4: warning: rtfonly section ended without end marker ``` in case of a problem like: ``` /** \file * \rtfonly * RTF /* Nested */ * \endrtfonly */ ``` --- src/doctokenizer.l | 8 ++++++++ src/scanner.l | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 4882570..11e96d6 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -1296,6 +1296,14 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_endMarker="endlatexonly"; BEGIN(St_SecSkip); } +{CMD}"manonly"/[^a-z_A-Z0-9] { + g_endMarker="endmanonly"; + BEGIN(St_SecSkip); + } +{CMD}"rtfonly"/[^a-z_A-Z0-9] { + g_endMarker="endrtfonly"; + BEGIN(St_SecSkip); + } {CMD}"xmlonly"/[^a-z_A-Z0-9] { g_endMarker="endxmlonly"; BEGIN(St_SecSkip); diff --git a/src/scanner.l b/src/scanner.l index 187a9ff..cb6f5a3 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4274,7 +4274,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) unput(yyextra->lastCopyArgChar); BEGIN( yyextra->lastCommentInArgContext ); } -{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) +{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) yyextra->docBlockName=&yytext[1]; yyextra->fullArgString+=yytext; BEGIN(CopyArgVerbatim); @@ -4292,7 +4292,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) yyextra->fullArgString+=yytext; BEGIN(CopyArgVerbatim); } -[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9\-] { // end of verbatim block +[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9\-] { // end of verbatim block yyextra->fullArgString+=yytext; if (yytext[1]=='f') // end of formula { @@ -6254,7 +6254,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) yyextra->nestedComment=FALSE; BEGIN(DocCopyBlock); } -{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) +{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) yyextra->docBlock+=yytext; yyextra->docBlockName=&yytext[1]; yyextra->fencedSize=0; @@ -6322,7 +6322,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) yyextra->docBlock+=yytext; BEGIN(DocBlock); } -[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block +[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block yyextra->docBlock+=yytext; if (&yytext[4]==yyextra->docBlockName) { -- cgit v0.12