summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-07-07 13:02:31 (GMT)
committerGitHub <noreply@github.com>2018-07-07 13:02:31 (GMT)
commit9da177230f5d6f18ebe498c949e4edf9039a63db (patch)
treecaad6b733c65cea94966f803c8e84ed476b8180e
parentd61003265a2fc4505e87c2947c42b18e4bee371b (diff)
parenta0db6fdbff2e21502bb2ac7437c5bd57d515d83b (diff)
downloadDoxygen-9da177230f5d6f18ebe498c949e4edf9039a63db.zip
Doxygen-9da177230f5d6f18ebe498c949e4edf9039a63db.tar.gz
Doxygen-9da177230f5d6f18ebe498c949e4edf9039a63db.tar.bz2
Merge pull request #773 from albert-github/feature/bug_796621
Bug 796621 - @cond does not stop at @endcond Fortran
-rw-r--r--src/commentcnv.l20
-rw-r--r--src/fortrancode.l3
-rw-r--r--src/fortranscanner.l8
-rw-r--r--src/pre.l24
4 files changed, 39 insertions, 16 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 10dab28..88236ed 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -591,7 +591,15 @@ void replaceComment(int offset);
copyToOutput(yytext,(int)yyleng);
}
<SkipString>\\. { /* escaped character in string */
- copyToOutput(yytext,(int)yyleng);
+ if (g_lang==SrcLangExt_Fortran)
+ {
+ unput(yytext[1]);
+ copyToOutput(yytext,1);
+ }
+ else
+ {
+ copyToOutput(yytext,(int)yyleng);
+ }
}
<SkipString>"\"" { /* end of string */
copyToOutput(yytext,(int)yyleng);
@@ -604,7 +612,15 @@ void replaceComment(int offset);
copyToOutput(yytext,(int)yyleng);
}
<SkipChar>\\. { /* escaped character */
- copyToOutput(yytext,(int)yyleng);
+ if (g_lang==SrcLangExt_Fortran)
+ {
+ unput(yytext[1]);
+ copyToOutput(yytext,1);
+ }
+ else
+ {
+ copyToOutput(yytext,(int)yyleng);
+ }
}
<SkipChar>' { /* end of character literal */
copyToOutput(yytext,(int)yyleng);
diff --git a/src/fortrancode.l b/src/fortrancode.l
index e64c38e..3c1829d 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -1194,9 +1194,6 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
g_insideBody=FALSE;
}
/*------ strings --------------------------------------------------*/
-<*>"\\\\" { str+=yytext; /* ignore \\ */}
-<*>"\\\""|\\\' { str+=yytext; /* ignore \" */}
-
<String>\n { // string with \n inside
g_contLineNr++;
str+=yytext;
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index d0503c2..884c86e 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -383,14 +383,6 @@ SCOPENAME ({ID}{BS}"::"{BS})*
/*------ ignore strings that are not initialization strings */
-<*>"\\\\" { if (yy_top_state() == Initialization
- || yy_top_state() == ArrayInitializer)
- initializer+=yytext;
- }
-<*>"\\\""|\\\' { if (yy_top_state() == Initialization
- || yy_top_state() == ArrayInitializer)
- initializer+=yytext;
- }
<String>\"|\' { // string ends with next quote without previous backspace
if (yytext[0]!=stringStartSymbol) { yyColNr -= (int)yyleng; REJECT; } // single vs double quote
if (yy_top_state() == Initialization
diff --git a/src/pre.l b/src/pre.l
index 37f7115..2cc66c1 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1740,6 +1740,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x CopyLine
%x CopyString
%x CopyStringFtn
+%x CopyStringFtnDouble
%x Include
%x IncludeID
%x EndImport
@@ -1851,7 +1852,14 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<CopyLine>\" {
outputChar(*yytext);
- BEGIN( CopyString );
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran)
+ {
+ BEGIN( CopyString );
+ }
+ else
+ {
+ BEGIN( CopyStringFtnDouble );
+ }
}
<CopyLine>\' {
if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
@@ -1859,7 +1867,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN( CopyStringFtn );
}
<CopyString>[^\"\\\r\n]+ {
- outputArray(yytext,(int)yyleng);
+ outputArray(yytext,(int)yyleng);
}
<CopyString>\\. {
outputArray(yytext,(int)yyleng);
@@ -1868,8 +1876,18 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyLine );
}
+<CopyStringFtnDouble>[^\"\\\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtnDouble>\\. {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtnDouble>\" {
+ outputChar(*yytext);
+ BEGIN( CopyLine );
+ }
<CopyStringFtn>[^\'\\\r\n]+ {
- outputArray(yytext,(int)yyleng);
+ outputArray(yytext,(int)yyleng);
}
<CopyStringFtn>\\. {
outputArray(yytext,(int)yyleng);