summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-06-18 12:44:08 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-06-18 12:44:08 (GMT)
commit179f80e666d6c017f7130b6b26e687f2b5ea54d9 (patch)
tree3f729e0cd4b4798e0bfcdf348a2da9c0762398b4 /src/pre.l
parent4536982bdebc0056d0c5d64a12881f20b5801c06 (diff)
downloadDoxygen-179f80e666d6c017f7130b6b26e687f2b5ea54d9.zip
Doxygen-179f80e666d6c017f7130b6b26e687f2b5ea54d9.tar.gz
Doxygen-179f80e666d6c017f7130b6b26e687f2b5ea54d9.tar.bz2
Bug 630931 - \cond after @string literal containing backslash fails in C#
Special handling in preprocessor for CSharp literal strings (i.e. strings starting with @).
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pre.l b/src/pre.l
index 37f7115..c763f1a 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1739,6 +1739,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x SkipString
%x CopyLine
%x CopyString
+%x CopyStringCs
%x CopyStringFtn
%x Include
%x IncludeID
@@ -1849,6 +1850,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<CopyLine>"'"."'" {
outputArray(yytext,(int)yyleng);
}
+<CopyLine>@\" {
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_CSharp) REJECT;
+ outputArray(yytext,(int)yyleng);
+ BEGIN( CopyStringCs );
+ }
<CopyLine>\" {
outputChar(*yytext);
BEGIN( CopyString );
@@ -1861,10 +1867,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<CopyString>[^\"\\\r\n]+ {
outputArray(yytext,(int)yyleng);
}
+<CopyStringCs>[^\"\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
<CopyString>\\. {
outputArray(yytext,(int)yyleng);
}
-<CopyString>\" {
+<CopyString,CopyStringCs>\" {
outputChar(*yytext);
BEGIN( CopyLine );
}