Skip to content

Commit babbc98

Browse files
authored
Merge pull request doxygen#11612 from albert-github/feature/bug_consist_cmd
Consistent use of `{CMD}`
2 parents 9d479c8 + df95c24 commit babbc98

File tree

7 files changed

+55
-54
lines changed

7 files changed

+55
-54
lines changed

src/commentcnv.l

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ SLASHopt [/]*
435435
yyextra->inRoseComment=TRUE;
436436
BEGIN(SComment);
437437
}
438-
<Scan>{CPPC}[!\/]/.*\n[ \t]*{CPPC}[|\/][ \t]*[@\\]"}" { // next line contains an end marker, see bug 752712
438+
<Scan>{CPPC}[!\/]/.*\n[ \t]*{CPPC}[|\/][ \t]*{CMD}"}" { // next line contains an end marker, see bug 752712
439439
yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
440440
if (yyextra->inSpecialComment)
441441
{
@@ -595,7 +595,7 @@ SLASHopt [/]*
595595
yyextra->inVerbatim=true;
596596
BEGIN(VerbatimCode);
597597
}
598-
<CComment,ReadLine,IncludeFile>[\\@]("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */
598+
<CComment,ReadLine,IncludeFile>{CMD}("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */
599599
copyToOutput(yyscanner,yytext,yyleng);
600600
yyextra->lastCommentContext = YY_START;
601601
yyextra->javaBlock=0;
@@ -610,7 +610,7 @@ SLASHopt [/]*
610610
yyextra->inVerbatim=true;
611611
BEGIN(VerbatimCode);
612612
}
613-
<CComment,ReadLine,IncludeFile>[\\@]("f$"|"f["|"f{"|"f(") {
613+
<CComment,ReadLine,IncludeFile>{CMD}("f$"|"f["|"f{"|"f(") {
614614
copyToOutput(yyscanner,yytext,yyleng);
615615
yyextra->blockName=&yytext[1];
616616
if (yyextra->blockName.at(1)=='[')
@@ -651,7 +651,7 @@ SLASHopt [/]*
651651
yyextra->inVerbatim=true;
652652
BEGIN(Verbatim);
653653
}
654-
<CComment,ReadLine,IncludeFile>[\\@]("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly")/[^a-z_A-Z0-9] { /* start of a verbatim block */
654+
<CComment,ReadLine,IncludeFile>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly")/[^a-z_A-Z0-9] { /* start of a verbatim block */
655655
copyToOutput(yyscanner,yytext,yyleng);
656656
yyextra->blockName=QCString("end")+&yytext[1];
657657
yyextra->lastCommentContext = YY_START;
@@ -667,7 +667,7 @@ SLASHopt [/]*
667667
<Scan>. { /* any other character */
668668
copyToOutput(yyscanner,yytext,yyleng);
669669
}
670-
<Verbatim>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
670+
<Verbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
671671
copyToOutput(yyscanner,yytext,yyleng);
672672
if (&yytext[1]==yyextra->blockName) // end of command or formula
673673
{
@@ -722,7 +722,7 @@ SLASHopt [/]*
722722
BEGIN(yyextra->lastCommentContext);
723723
}
724724
}
725-
<VerbatimCode>[\\@]("enddot"|"endcode"|"endmsc"|"enduml")/("{")? { /* end of verbatim block */
725+
<VerbatimCode>{CMD}("enddot"|"endcode"|"endmsc"|"enduml")/("{")? { /* end of verbatim block */
726726
copyToOutput(yyscanner,yytext,yyleng);
727727
if (&yytext[1]==yyextra->blockName)
728728
{
@@ -1041,7 +1041,7 @@ SLASHopt [/]*
10411041
yyextra->readLineCtx=YY_START;
10421042
BEGIN(ReadLine);
10431043
}
1044-
<SComment>\n[ \t]*{CPPC}[\/!]("<")?[ \t]*[\\@]"}".*\n {
1044+
<SComment>\n[ \t]*{CPPC}[\/!]("<")?[ \t]*{CMD}"}".*\n {
10451045
/* See Bug 752712: end the multiline comment when finding a @} or \} command */
10461046
copyToOutput(yyscanner," */");
10471047
copyToOutput(yyscanner,yytext,yyleng);
@@ -1125,11 +1125,11 @@ SLASHopt [/]*
11251125
<CComment,CNComment,ReadLine>"\\<" { /* escaped html comment */
11261126
copyToOutput(yyscanner,yytext,yyleng);
11271127
}
1128-
<CComment,CNComment,ReadLine>[\\@][\\@][~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command
1128+
<CComment,CNComment,ReadLine>{CMD}{CMD}[~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command
11291129
copyToOutput(yyscanner,yytext,yyleng);
11301130
}
11311131

1132-
<CComment,ReadLine,IncludeFile>[\\@]("include"{OPTS}|"includedoc"{OPTS}*) {
1132+
<CComment,ReadLine,IncludeFile>{CMD}("include"{OPTS}|"includedoc"{OPTS}*) {
11331133
if (!parseIncludeOptions(yyscanner,std::string_view{yytext,static_cast<size_t>(yyleng)})) REJECT;
11341134
yyextra->includeCtx = YY_START;
11351135
yyextra->firstIncludeLine = true;
@@ -1141,7 +1141,7 @@ SLASHopt [/]*
11411141
//printf("blockHeadCol=%d insertCommentCol=%d\n",yyextra->blockHeadCol, yyextra->insertCommentCol);
11421142
BEGIN(IncludeDoc);
11431143
}
1144-
<CComment,ReadLine,IncludeFile>[\\@]("snippet"{OPTS}|"snippetdoc"{OPTS}*) {
1144+
<CComment,ReadLine,IncludeFile>{CMD}("snippet"{OPTS}|"snippetdoc"{OPTS}*) {
11451145
if (!parseIncludeOptions(yyscanner,std::string_view{yytext,static_cast<size_t>(yyleng)})) REJECT;
11461146
yyextra->includeCtx = YY_START;
11471147
yyextra->firstIncludeLine = true;
@@ -1207,11 +1207,11 @@ SLASHopt [/]*
12071207
copyToOutput(yyscanner,yytext,yyleng);
12081208
BEGIN(yyextra->includeCtx);
12091209
}
1210-
<CComment,ReadLine,IncludeFile>[\\@]"cond"/[^a-z_A-Z0-9] { // conditional section
1210+
<CComment,ReadLine,IncludeFile>{CMD}"cond"/[^a-z_A-Z0-9] { // conditional section
12111211
yyextra->condCtx = YY_START;
12121212
BEGIN(CondLine);
12131213
}
1214-
<CComment,ReadLine,IncludeFile>[\\@]"endcond"/[^a-z_A-Z0-9] { // end of conditional section
1214+
<CComment,ReadLine,IncludeFile>{CMD}"endcond"/[^a-z_A-Z0-9] { // end of conditional section
12151215
bool oldSkip=yyextra->skip;
12161216
endCondSection(yyscanner);
12171217
if (YY_START==CComment && oldSkip && !yyextra->skip)
@@ -1236,7 +1236,7 @@ SLASHopt [/]*
12361236
<CondLine>[!()&| \ta-z_A-Z0-9.\-]+ {
12371237
handleCondSectionId(yyscanner,yytext);
12381238
}
1239-
<CComment,ReadLine,IncludeFile>[\\@]"cond"{WSopt}/\n {
1239+
<CComment,ReadLine,IncludeFile>{CMD}"cond"{WSopt}/\n {
12401240
yyextra->condCtx=YY_START;
12411241
handleCondSectionId(yyscanner," "); // fake section id causing the section to be hidden unconditionally
12421242
}
@@ -1245,10 +1245,10 @@ SLASHopt [/]*
12451245
handleCondSectionId(yyscanner," "); // fake section id causing the section to be hidden unconditionally
12461246
if (*yytext=='\n') { copyToOutput(yyscanner,"\n");}
12471247
}
1248-
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>[\\@][a-z_A-Z][a-z_A-Z0-9-]* { // expand alias without arguments
1248+
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{CMD}[a-z_A-Z][a-z_A-Z0-9-]* { // expand alias without arguments
12491249
replaceAliases(yyscanner,yytext,YY_START==ReadLine && yyextra->readLineCtx==SComment);
12501250
}
1251-
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{B}?{CMD}"ilinebr"{B}[\\@]"ialias{" { // expand alias with arguments
1251+
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{B}?{CMD}"ilinebr"{B}{CMD}"ialias{" { // expand alias with arguments
12521252
yyextra->lastBlockContext=YY_START;
12531253
yyextra->blockCount=1;
12541254
int extraSpace = (yytext[0]==' '? 1:0);
@@ -1257,7 +1257,7 @@ SLASHopt [/]*
12571257
yyextra->lastEscaped=0;
12581258
BEGIN( ReadAliasArgs );
12591259
}
1260-
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>[\\@][a-z_A-Z][a-z_A-Z0-9-]*"{" { // expand alias with arguments
1260+
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{CMD}[a-z_A-Z][a-z_A-Z0-9-]*"{" { // expand alias with arguments
12611261
yyextra->lastBlockContext=YY_START;
12621262
yyextra->blockCount=1;
12631263
yyextra->aliasString=yytext;
@@ -1278,7 +1278,7 @@ SLASHopt [/]*
12781278
else yyextra->lastEscaped=TRUE;
12791279
yyextra->aliasString+=yytext;
12801280
}
1281-
<ReadAliasArgs>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
1281+
<ReadAliasArgs>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
12821282
yyextra->aliasString+=yytext;
12831283
if (yyextra->inVerbatim && &yytext[1]==yyextra->blockName)
12841284
// For verbatim sections we do not support matching end block markers inside

src/commentscan.l

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,63 +2477,63 @@ STopt [^\n@\\]*
24772477
if (*yytext=='\n') yyextra->lineNr++;
24782478
addOutput(yyscanner,'\n');
24792479
}
2480-
<SkipInternal>[@\\]"if"/[ \t] {
2480+
<SkipInternal>{CMD}"if"/[ \t] {
24812481
yyextra->condCount++;
24822482
}
2483-
<SkipInternal>[@\\]"ifnot"/[ \t] {
2483+
<SkipInternal>{CMD}"ifnot"/[ \t] {
24842484
yyextra->condCount++;
24852485
}
2486-
<SkipInternal>[@\\]/"endif" {
2486+
<SkipInternal>{CMD}/"endif" {
24872487
yyextra->condCount--;
24882488
if (yyextra->condCount<0) // handle conditional section around of \internal, see bug607743
24892489
{
24902490
unput('\\');
24912491
BEGIN(Comment);
24922492
}
24932493
}
2494-
<SkipInternal>[@\\]/"section"[ \t] {
2494+
<SkipInternal>{CMD}/"section"[ \t] {
24952495
if (yyextra->sectionLevel>0)
24962496
{
24972497
unput('\\');
24982498
BEGIN(Comment);
24992499
}
25002500
}
2501-
<SkipInternal>[@\\]/"subsection"[ \t] {
2501+
<SkipInternal>{CMD}/"subsection"[ \t] {
25022502
if (yyextra->sectionLevel>1)
25032503
{
25042504
unput('\\');
25052505
BEGIN(Comment);
25062506
}
25072507
}
2508-
<SkipInternal>[@\\]/"subsubsection"[ \t] {
2508+
<SkipInternal>{CMD}/"subsubsection"[ \t] {
25092509
if (yyextra->sectionLevel>2)
25102510
{
25112511
unput('\\');
25122512
BEGIN(Comment);
25132513
}
25142514
}
2515-
<SkipInternal>[@\\]/"paragraph"[ \t] {
2515+
<SkipInternal>{CMD}/"paragraph"[ \t] {
25162516
if (yyextra->sectionLevel>3)
25172517
{
25182518
unput('\\');
25192519
BEGIN(Comment);
25202520
}
25212521
}
2522-
<SkipInternal>[@\\]/"subparagraph"[ \t] {
2522+
<SkipInternal>{CMD}/"subparagraph"[ \t] {
25232523
if (yyextra->sectionLevel>4)
25242524
{
25252525
unput('\\');
25262526
BEGIN(Comment);
25272527
}
25282528
}
2529-
<SkipInternal>[@\\]/"subsubparagraph"[ \t] {
2529+
<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
25302530
if (yyextra->sectionLevel>5)
25312531
{
25322532
unput('\\');
25332533
BEGIN(Comment);
25342534
}
25352535
}
2536-
<SkipInternal>[@\\]"endinternal"[ \t]* {
2536+
<SkipInternal>{CMD}"endinternal"[ \t]* {
25372537
BEGIN(Comment);
25382538
}
25392539
<SkipInternal>[^ \\@\n]+ { // skip non-special characters
@@ -2729,7 +2729,7 @@ STopt [^\n@\\]*
27292729

27302730
/* ----- handle language specific sections ------- */
27312731

2732-
<SkipLang>[\\@]"~"[a-zA-Z-]* { /* language switch */
2732+
<SkipLang>{CMD}"~"[a-zA-Z-]* { /* language switch */
27332733
QCString langId(&yytext[2]);
27342734
if (!langId.isEmpty() && !Config_isAvailableEnum(OUTPUT_LANGUAGE,langId))
27352735
{

src/fortranscanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ private {
15711571
BEGIN(DocBlock);
15721572
}
15731573
}
1574-
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
1574+
<DocCopyBlock>{CMD}("f$"|"f]"|"f}"|"f)") {
15751575
yyextra->docBlock += yytext;
15761576
if (yyextra->docBlockName==&yytext[1])
15771577
{
@@ -1581,7 +1581,7 @@ private {
15811581
BEGIN(DocBlock);
15821582
}
15831583
}
1584-
<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
1584+
<DocCopyBlock>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
15851585
yyextra->docBlock += yytext;
15861586
if (&yytext[4]==yyextra->docBlockName)
15871587
{

src/lexcode.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,14 +820,14 @@ NONLopt [^\n]*
820820
BEGIN(DocBlock);
821821
}
822822
}
823-
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
823+
<DocCopyBlock>{CMD}("f$"|"f]"|"f}"|"f)") {
824824
yyextra->CCodeBuffer += yytext;
825825
if (yyextra->docBlockName==&yytext[1])
826826
{
827827
BEGIN(DocBlock);
828828
}
829829
}
830-
<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
830+
<DocCopyBlock>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
831831
yyextra->CCodeBuffer += yytext;
832832
if (&yytext[4]==yyextra->docBlockName)
833833
{

src/lexscanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,14 +795,14 @@ NONLopt [^\n]*
795795
BEGIN(DocBlock);
796796
}
797797
}
798-
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
798+
<DocCopyBlock>{CMD}("f$"|"f]"|"f}"|"f)") {
799799
yyextra->cCodeBuffer += yytext;
800800
if (yyextra->docBlockName==&yytext[1])
801801
{
802802
BEGIN(DocBlock);
803803
}
804804
}
805-
<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
805+
<DocCopyBlock>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
806806
yyextra->cCodeBuffer += yytext;
807807
if (yyextra->docBlockName==&yytext[4])
808808
{

0 commit comments

Comments
 (0)