Skip to content

Commit 2eb5efd

Browse files
committed
issue #10516 @copybrief command does not take effect with 1.10.0
After review removed necessity of a second regex
1 parent 3fe21ae commit 2eb5efd

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/commentscan.l

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,26 +3841,23 @@ static inline void setOutput(yyscan_t yyscanner,OutputContext ctx)
38413841
}
38423842
else
38433843
{
3844-
static const reg::Ex nonBrief(R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr *\n)");
3845-
static const reg::Ex nonBrief1(R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *\d+ *[\\@]ilinebr *)");
3844+
static const reg::Ex nonBrief(R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr *([\n]?))");
38463845
std::string str = yyextra->current->brief.str();
38473846
reg::Match match;
3848-
reg::Match match1;
38493847
if (reg::match(str,match,nonBrief)) // match found
38503848
{
3851-
yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-1);
3852-
// set warning line correct
3853-
yyextra->current->brief += "\\iline " + QCString().setNum(1 + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
3854-
foundMatch = true;
3855-
}
3856-
else if (reg::match(str,match1,nonBrief1)) // match found
3857-
{
3849+
if (QCString(match[2].str()) == "\n")
3850+
{
3851+
yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-1);
3852+
// set warning line correct
3853+
yyextra->current->brief += "\\iline " + QCString().setNum(1 + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
3854+
}
38583855
foundMatch = true;
38593856
}
38603857
}
38613858
if (foundMatch)
38623859
{
3863-
yyextra->pOutputString = &yyextra->current->brief;
3860+
yyextra->pOutputString = &yyextra->current->brief;
38643861
}
38653862
else
38663863
{

0 commit comments

Comments
 (0)