Skip to content

Commit

Permalink
More \ilinebr related cleanup and combined some rules
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Jul 28, 2020
1 parent 4fbe0ad commit 2340c1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/commentscan.l
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &,
static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handleLineBr(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handleStatic(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handlePure(yyscan_t yyscanner,const QCString &, const QCStringList &);
static bool handlePrivate(yyscan_t yyscanner,const QCString &, const QCStringList &);
Expand Down
48 changes: 19 additions & 29 deletions src/doctokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->name = g_token->name.mid(i+1,g_token->name.length()-i-2);
BEGIN(St_Code);
}
<St_CodeOpt>"\\ilinebr" |
<St_CodeOpt>\n |
<St_CodeOpt>. {
unput(*yytext);
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
BEGIN(St_Code);
}
<St_Code>{WS}*{CMD}"endcode" {
Expand All @@ -834,6 +835,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
unput(*yytext);
BEGIN(St_HtmlOnly);
}
<St_HtmlOnlyOption>"\\ilinebr" {
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
BEGIN(St_HtmlOnly);
}
<St_HtmlOnly>{CMD}"endhtmlonly" {
return RetVal_OK;
}
Expand Down Expand Up @@ -925,10 +930,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/"\\linebr" { // case 5: plain file name specified without title or attributes
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
<St_PlantUMLOpt>"\\ilinebr" |
<St_PlantUMLOpt>"\n" |
<St_PlantUMLOpt>. {
g_token->sectionId = "";
unput(*yytext);
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return RetVal_OK;
}
<St_PlantUML>{CMD}"enduml" {
Expand Down Expand Up @@ -990,11 +1000,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->chars=yytext;
return TK_WHITESPACE;
}
<St_TitleN>\n { /* new line => end of title */
unput(*yytext);
return 0;
}
<St_TitleN>"\\ilinebr" {
<St_TitleN>(\n|"\\ilinebr") { /* new line => end of title */
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return 0;
}
Expand All @@ -1021,11 +1027,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
BEGIN(St_TitleA);
return 0;
}
<St_TitleQ>\n { /* new line => end of title */
unput(*yytext);
return 0;
}
<St_TitleQ>"\\ilinebr" {
<St_TitleQ>(\n|"\\ilinebr") { /* new line => end of title */
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return 0;
}
Expand All @@ -1043,11 +1045,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
unput(*yytext);
return 0;
}
<St_TitleV,St_TitleA>\n {
unput(*yytext);
return 0;
}
<St_TitleV,St_TitleA>"\\ilinebr" {
<St_TitleV,St_TitleA>(\n|"\\ilinebr") {
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return 0;
}
Expand Down Expand Up @@ -1076,14 +1074,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
unput(' ');
return 0;
}
<St_Cite>\n { // new line
unput(*yytext);
return 0;
}
<St_Cite>"\\ilinebr" {
<St_Cite>(\n|"\\ilinebr") { // new line
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return 0;
}
}
<St_Cite>. { // any other character
unput(*yytext);
return 0;
Expand All @@ -1107,14 +1101,10 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
<St_Ref>{WS}+"\""{WS}* { // white space following by quoted string
BEGIN(St_Ref2);
}
<St_Ref>\n { // new line
unput(*yytext);
return 0;
}
<St_Ref>"\\ilinebr" {
<St_Ref>(\n|"\\ilinebr") { // new line
for (int i=yyleng-1;i>=0;i--) unput(yytext[i]);
return 0;
}
}
<St_Ref>. { // any other character
unput(*yytext);
return 0;
Expand Down

0 comments on commit 2340c1e

Please sign in to comment.