Skip to content

Commit 2340c1e

Browse files
committed
More \ilinebr related cleanup and combined some rules
1 parent 4fbe0ad commit 2340c1e

File tree

2 files changed

+19
-30
lines changed

2 files changed

+19
-30
lines changed

src/commentscan.l

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &,
119119
static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
120120
static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
121121
static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringList &);
122-
static bool handleLineBr(yyscan_t yyscanner,const QCString &, const QCStringList &);
123122
static bool handleStatic(yyscan_t yyscanner,const QCString &, const QCStringList &);
124123
static bool handlePure(yyscan_t yyscanner,const QCString &, const QCStringList &);
125124
static bool handlePrivate(yyscan_t yyscanner,const QCString &, const QCStringList &);

src/doctokenizer.l

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
810810
g_token->name = g_token->name.mid(i+1,g_token->name.length()-i-2);
811811
BEGIN(St_Code);
812812
}
813+
<St_CodeOpt>"\\ilinebr" |
813814
<St_CodeOpt>\n |
814815
<St_CodeOpt>. {
815-
unput(*yytext);
816+
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
816817
BEGIN(St_Code);
817818
}
818819
<St_Code>{WS}*{CMD}"endcode" {
@@ -834,6 +835,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
834835
unput(*yytext);
835836
BEGIN(St_HtmlOnly);
836837
}
838+
<St_HtmlOnlyOption>"\\ilinebr" {
839+
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
840+
BEGIN(St_HtmlOnly);
841+
}
837842
<St_HtmlOnly>{CMD}"endhtmlonly" {
838843
return RetVal_OK;
839844
}
@@ -925,10 +930,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
925930
g_token->sectionId = QCString(yytext).stripWhiteSpace();
926931
return RetVal_OK;
927932
}
933+
<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/"\\linebr" { // case 5: plain file name specified without title or attributes
934+
g_token->sectionId = QCString(yytext).stripWhiteSpace();
935+
return RetVal_OK;
936+
}
937+
<St_PlantUMLOpt>"\\ilinebr" |
928938
<St_PlantUMLOpt>"\n" |
929939
<St_PlantUMLOpt>. {
930940
g_token->sectionId = "";
931-
unput(*yytext);
941+
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
932942
return RetVal_OK;
933943
}
934944
<St_PlantUML>{CMD}"enduml" {
@@ -990,11 +1000,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
9901000
g_token->chars=yytext;
9911001
return TK_WHITESPACE;
9921002
}
993-
<St_TitleN>\n { /* new line => end of title */
994-
unput(*yytext);
995-
return 0;
996-
}
997-
<St_TitleN>"\\ilinebr" {
1003+
<St_TitleN>(\n|"\\ilinebr") { /* new line => end of title */
9981004
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
9991005
return 0;
10001006
}
@@ -1021,11 +1027,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
10211027
BEGIN(St_TitleA);
10221028
return 0;
10231029
}
1024-
<St_TitleQ>\n { /* new line => end of title */
1025-
unput(*yytext);
1026-
return 0;
1027-
}
1028-
<St_TitleQ>"\\ilinebr" {
1030+
<St_TitleQ>(\n|"\\ilinebr") { /* new line => end of title */
10291031
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
10301032
return 0;
10311033
}
@@ -1043,11 +1045,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
10431045
unput(*yytext);
10441046
return 0;
10451047
}
1046-
<St_TitleV,St_TitleA>\n {
1047-
unput(*yytext);
1048-
return 0;
1049-
}
1050-
<St_TitleV,St_TitleA>"\\ilinebr" {
1048+
<St_TitleV,St_TitleA>(\n|"\\ilinebr") {
10511049
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
10521050
return 0;
10531051
}
@@ -1076,14 +1074,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
10761074
unput(' ');
10771075
return 0;
10781076
}
1079-
<St_Cite>\n { // new line
1080-
unput(*yytext);
1081-
return 0;
1082-
}
1083-
<St_Cite>"\\ilinebr" {
1077+
<St_Cite>(\n|"\\ilinebr") { // new line
10841078
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
10851079
return 0;
1086-
}
1080+
}
10871081
<St_Cite>. { // any other character
10881082
unput(*yytext);
10891083
return 0;
@@ -1107,14 +1101,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
11071101
<St_Ref>{WS}+"\""{WS}* { // white space following by quoted string
11081102
BEGIN(St_Ref2);
11091103
}
1110-
<St_Ref>\n { // new line
1111-
unput(*yytext);
1112-
return 0;
1113-
}
1114-
<St_Ref>"\\ilinebr" {
1104+
<St_Ref>(\n|"\\ilinebr") { // new line
11151105
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
11161106
return 0;
1117-
}
1107+
}
11181108
<St_Ref>. { // any other character
11191109
unput(*yytext);
11201110
return 0;

0 commit comments

Comments
 (0)