From e662aa66b182288591b91b569710e8b7a629c828 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Mar 2021 15:00:53 +0100 Subject: Usage of default lex rule with `\param` In case we have a file like ``` /// \file /// the fie /// \param /// arg the argument void fie(int arg); ``` we get in the console output extra empty lines, this is due to the fact that the default lex rule kicks in an the output is echoed to the consol. We have defined an explicit rule. --- src/commentscan.l | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commentscan.l b/src/commentscan.l index 89b8052..16db2d6 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1198,6 +1198,10 @@ STopt [^\n@\\]* "," { addOutput(yyscanner," , "); } +{DOCNL} { + if (*yytext=='\n') yyextra->lineNr++; + addOutput(yyscanner," "); + } {ID} { addOutput(yyscanner,yytext); BEGIN( Comment ); @@ -1897,6 +1901,10 @@ STopt [^\n@\\]* addOutput(yyscanner,yytext); } + /* +<*>. { fprintf(stderr,"Lex scanner %s %sdefault rule for state %s: #%s#\n", __FILE__,yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START),yytext);} +<*>\n { fprintf(stderr,"Lex scanner %s %sdefault rule newline for state %s.\n", __FILE__, yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START));} + */ %% -- cgit v0.12