@@ -65,6 +65,7 @@ typedef yyguts_t *yyscan_t;
6565#include " reflist.h"
6666#include " trace.h"
6767#include " debug.h"
68+ #include " stringutil.h"
6869
6970// forward declarations
7071static bool handleBrief (yyscan_t yyscanner,const QCString &, const StringVector &);
@@ -599,6 +600,7 @@ MAILADDR ("mailto:")?[a-z_A-Z0-9\x80-\xff.+-]+"@"[a-z_A-Z0-9\x80-\xff-]+("."[a-
599600RCSTAG " $" {ID }" :" [^\n$]+" $"
600601MODULE_ID ({ID }" ." )*{ID }
601602LINENR {Bopt}[1 -9 ][0 -9 ]*
603+ IFILELINE (" \\ ifile \" " [^" ]*" \" \\ iline " [0 -9 ]+" " (" iprefix \" " [^" ]*" \" " )?(" iraise " [0 -9 ]+" " )?)
602604
603605 // C start comment
604606CCS " /\*"
@@ -899,6 +901,16 @@ STopt [^\n@\\]*
899901<Comment >{B }* " \\ ilinebr" {B }* { // preserve spacing around \\ilinebr
900902 addOutput (yyscanner,yytext);
901903 }
904+ <Comment >(\n | \\ ilinebr)/ ({B }* (\n | {IFILELINE }? \\ ilinebr))+ { // at least one blank line (or blank line command)
905+ if (yyextra->inContext ==OutputBrief)
906+ {
907+ endBrief (yyscanner);
908+ }
909+ else
910+ {
911+ REJECT ;
912+ }
913+ }
902914<Comment >{B }* {CMD }[a -z_A -Z ]+ " {" [^ } ]* " }" {B }* |
903915<Comment >{B }* {CMD }[a -z_A -Z ]+ {B }* { // potentially interesting command
904916 // the {B}* in the front was added for bug620924
@@ -1471,7 +1483,7 @@ STopt [^\n@\\]*
14711483 // if (*yytext=='\n') yyextra->lineNr++;
14721484 // addOutput(yyscanner,'\n');
14731485 addOutput (yyscanner," \\ ifile \" " + yyextra->fileName );
1474- addOutput (yyscanner," \" \\ ilinebr \\ iline " + QCString ().setNum (yyextra->lineNr + extraLineNr) + " \\ ilinebr " );
1486+ addOutput (yyscanner," \" \\ iline " + QCString ().setNum (yyextra->lineNr + extraLineNr) + " \\ ilinebr " );
14751487 BEGIN ( Comment );
14761488 }
14771489<GroupDocArg2 >. { // title (stored in type)
@@ -1524,7 +1536,7 @@ STopt [^\n@\\]*
15241536 // if (*yytext=='\n') yyextra->lineNr++;
15251537 // addOutput(yyscanner,'\n');
15261538 addOutput (yyscanner," \\ ifile \" " + yyextra->fileName );
1527- addOutput (yyscanner," \" \\ ilinebr \\ iline " + QCString ().setNum (yyextra->lineNr ) + " \\ ilinebr " );
1539+ addOutput (yyscanner," \" \\ iline " + QCString ().setNum (yyextra->lineNr ) + " \\ ilinebr " );
15281540 BEGIN ( Comment );
15291541 }
15301542<PageDocArg2 >{CMD }[<> ] {
@@ -4253,6 +4265,7 @@ static void addCite(yyscan_t yyscanner)
42534265}
42544266
42554267// -----------------------------------------------------------------------------
4268+ static const reg::Ex nonBrief_re (R"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr( *\n*))" );
42564269
42574270// strip trailing whitespace (excluding newlines) from string s
42584271static void stripTrailingWhiteSpace (QCString &s)
@@ -4390,15 +4403,14 @@ static inline void setOutput(yyscan_t yyscanner,OutputContext ctx)
43904403 }
43914404 else
43924405 {
4393- static const reg::Ex nonBrief (R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr( *\n*))" );
43944406 std::string str = yyextra->current ->brief .str ();
43954407 reg::Match match;
4396- if (reg::match (str,match,nonBrief )) // match found
4408+ if (reg::match (str,match,nonBrief_re )) // match found
43974409 {
43984410 size_t cnt = 0 ;
43994411 for (size_t i = 0 ; i < match[2 ].str ().size (); i++)
44004412 {
4401- if (match[2 ].str ()[i] == ' \n ' ) cnt++;
4413+ if (match[2 ].str ()[i] == ' \n ' ) cnt++;
44024414 }
44034415 if (cnt)
44044416 {
@@ -4508,10 +4520,9 @@ static void addIlineBreak(yyscan_t yyscanner,int lineNr)
45084520static void endBrief (yyscan_t yyscanner)
45094521{
45104522 struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
4511- static const reg::Ex nonBrief (R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr( *\n*))" );
4512- std::string str = yyextra->current ->brief .str ();
4523+ std::string_view str = yyextra->current ->brief .view ();
45134524 reg::Match match;
4514- if (!yyextra-> current -> brief . stripWhiteSpace (). isEmpty () && !reg::match (str,match,nonBrief ))
4525+ if (!stripWhiteSpace (str). empty () && !reg::match (str,match,nonBrief_re ))
45154526 { // only go to the detailed description if we have
45164527 // found some brief description and not just whitespace
45174528 yyextra->briefEndsAtDot =FALSE ;
0 commit comments