summaryrefslogtreecommitdiffstats
path: root/src/commentcnv.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-06-29 20:14:58 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-06-29 20:14:58 (GMT)
commit9f83539241a64ce7f74d80c118e555e1fc8f8077 (patch)
treee669e210441ef87fa9a366b99d90a0c8d8ae944b /src/commentcnv.l
parent0bb78ec1f61b95b550b65361081c01a104728341 (diff)
downloadDoxygen-9f83539241a64ce7f74d80c118e555e1fc8f8077.zip
Doxygen-9f83539241a64ce7f74d80c118e555e1fc8f8077.tar.gz
Doxygen-9f83539241a64ce7f74d80c118e555e1fc8f8077.tar.bz2
Release-1.7.4-20110629
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r--src/commentcnv.l34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 6884865..ac72394 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -64,6 +64,8 @@ static QCString g_blockName;
static int g_lastCommentContext;
static bool g_inSpecialComment;
static bool g_inRoseComment;
+static int g_stringContext;
+static int g_charContext;
static int g_javaBlock;
static bool g_specialComment;
@@ -310,10 +312,12 @@ void replaceComment(int offset);
}
<Scan>"\"" { /* start of a string */
copyToOutput(yytext,yyleng);
+ g_stringContext = YY_START;
BEGIN(SkipString);
}
<Scan>' {
copyToOutput(yytext,yyleng);
+ g_charContext = YY_START;
BEGIN(SkipChar);
}
<Scan>\n { /* new line */
@@ -506,7 +510,7 @@ void replaceComment(int offset);
}
<SkipString>"\"" { /* end of string */
copyToOutput(yytext,yyleng);
- BEGIN(Scan);
+ BEGIN(g_stringContext);
}
<SkipString>. { /* any other string character */
copyToOutput(yytext,yyleng);
@@ -519,7 +523,7 @@ void replaceComment(int offset);
}
<SkipChar>' { /* end of character literal */
copyToOutput(yytext,yyleng);
- BEGIN(Scan);
+ BEGIN(g_charContext);
}
<SkipChar>. { /* any other string character */
copyToOutput(yytext,yyleng);
@@ -528,10 +532,10 @@ void replaceComment(int offset);
copyToOutput(yytext,yyleng);
}
-<CComment>[^\\!@*\n{]* { /* anything that is not a '*' or command */
+<CComment>[^\\!@*\n{\"]* { /* anything that is not a '*' or command */
copyToOutput(yytext,yyleng);
}
-<CComment>"*"+[^*/\\@\n]* { /* stars without slashes */
+<CComment>"*"+[^*/\\@\n{\"]* { /* stars without slashes */
copyToOutput(yytext,yyleng);
}
<CComment>"\"\"\"" { /* end of Python docstring */
@@ -593,6 +597,16 @@ void replaceComment(int offset);
BEGIN(Scan);
}
}
+<CComment>"'" {
+ g_charContext = YY_START;
+ copyToOutput(yytext,yyleng);
+ BEGIN(SkipChar);
+ }
+<CComment>"\"" {
+ g_stringContext = YY_START;
+ copyToOutput(yytext,yyleng);
+ BEGIN(SkipString);
+ }
<CComment>. {
copyToOutput(yytext,yyleng);
}
@@ -734,6 +748,18 @@ void replaceComment(int offset);
}
<ReadAliasArgs>^[ \t]*"//"[/!]/[^\n]+ { // skip leading special comments (see bug 618079)
}
+<ReadAliasArgs>"*/" { // oops, end of comment in the middle of an alias?
+ if (g_lang==SrcLangExt_Python)
+ {
+ REJECT;
+ }
+ else // abort the alias, restart scanning
+ {
+ copyToOutput(g_aliasString,g_aliasString.length());
+ copyToOutput(yytext,yyleng);
+ BEGIN(Scan);
+ }
+ }
<ReadAliasArgs>[^{}\n\\\*]+ {
g_aliasString+=yytext;
g_lastEscaped=FALSE;