summaryrefslogtreecommitdiffstats
path: root/src/fortrancode.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2008-01-16 19:20:21 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2008-01-16 19:20:21 (GMT)
commitfc90c25edfba404f54319eaeeacca39246f95c9e (patch)
tree78bac4e928b25e139605aceefa82537f378d8af0 /src/fortrancode.l
parentf57b7d974fec18d1d8f325c102efd8be5930131d (diff)
downloadDoxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.zip
Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.gz
Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.bz2
Release-1.5.4
Diffstat (limited to 'src/fortrancode.l')
-rw-r--r--src/fortrancode.l18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fortrancode.l b/src/fortrancode.l
index daf9593..c71de8f 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -107,6 +107,7 @@ static Definition * g_currentDefinition;
static MemberDef * g_currentMemberDef;
static bool g_includeCodeFragment;
+static char stringStartSymbol; // single or double quote
static void endFontClass()
{
@@ -831,6 +832,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
}
<*>"!"[^>\n].*|"!"$ { // normal comment
+ if(YY_START == String) REJECT; // ignore in strings
startFontClass("comment");
codifyLines(yytext);
endFontClass();
@@ -846,26 +848,26 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
generateLink(*g_code, yytext);
g_insideBody=FALSE;
}
-
/*------ strings --------------------------------------------------*/
<*>"\\\\" { str+=yytext; /* ignore \\ */}
-<*>"\\\"" { str+=yytext; /* ignore \" */}
+<*>"\\\""|\\\' { str+=yytext; /* ignore \" */}
-<String>\" { // string ends with next quote without previous backspace
+<String>\"|\' { // string ends with next quote without previous backspace
+ if(yytext[0]!=stringStartSymbol) REJECT; // single vs double quote
str+=yytext;
startFontClass("stringliteral");
codifyLines(str);
endFontClass();
yy_pop_state();
}
-<*>\" { /* string starts */
+<*>\"|\' { /* string starts */
+ /* if(YY_START == StrIgnore) REJECT; // ignore in simple comments */
yy_push_state(YY_START);
- BEGIN(String);
+ stringStartSymbol=yytext[0]; // single or double quote
+ BEGIN(String);
str=yytext;
}
-<String>. {str+=yytext;}
-
-
+<String>. {str+=yytext;}
/*-----------------------------------------------------------------------------*/
<*>\n {