summaryrefslogtreecommitdiffstats
path: root/src/fortrancode.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2015-01-04 17:24:06 (GMT)
committeralbert-github <albert.tests@gmail.com>2015-01-04 17:24:06 (GMT)
commiteb92c064b33bf9f303233210b9693215b0fb7f9d (patch)
treeedb5418aa7a05957415df835e1bd6ff7e0e13071 /src/fortrancode.l
parentd49604f814ceb22f81571d8ca99540e62cfa979a (diff)
downloadDoxygen-eb92c064b33bf9f303233210b9693215b0fb7f9d.zip
Doxygen-eb92c064b33bf9f303233210b9693215b0fb7f9d.tar.gz
Doxygen-eb92c064b33bf9f303233210b9693215b0fb7f9d.tar.bz2
Fortran: fixed format position 73 and further is comment
According to the Fortran standard position 73 and further on a line are comment. Until now this was not considered.
Diffstat (limited to 'src/fortrancode.l')
-rw-r--r--src/fortrancode.l31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/fortrancode.l b/src/fortrancode.l
index 17a28c3..bf50835 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -50,6 +50,7 @@
#include "filedef.h"
#include "namespacedef.h"
#include "tooltip.h"
+#include "fortrancode.h"
// Toggle for some debugging info
//#define DBG_CTX(x) fprintf x
@@ -211,9 +212,14 @@ static void endFontClass()
static void startFontClass(const char *s)
{
- endFontClass();
- g_code->startFontClass(s);
- g_currentFontClass=s;
+ // if font class is already set don't stop and start it.
+ // strcmp does not like null pointers as input.
+ if (!g_currentFontClass || !s || strcmp(g_currentFontClass,s))
+ {
+ endFontClass();
+ g_code->startFontClass(s);
+ g_currentFontClass=s;
+ }
}
static void setCurrentDoc(const QCString &anchor)
@@ -1179,11 +1185,22 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
}
YY_FTN_RESET
}
-<*>^{BS}"type"{BS}"=" { g_code->codify(yytext); }
+<*>^{BS}"type"{BS}"=" { g_code->codify(yytext); }
-<*>. {
- g_code->codify(yytext);
- }
+<*>. {
+ if (g_isFixedForm && yy_my_start > fixedCommentAfter)
+ {
+ //yy_push_state(YY_START);
+ //BEGIN(DocBlock);
+ //docBlock=yytext;
+ startFontClass("comment");
+ codifyLines(yytext);
+ }
+ else
+ {
+ g_code->codify(yytext);
+ }
+ }
<*>{LOG_OPER} { // Fortran logical comparison keywords
g_code->codify(yytext);
}