diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-04-29 10:58:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-29 10:58:52 (GMT) |
commit | 2ff6bc1d172d0ab03f4164377786fa6c887e4854 (patch) | |
tree | 2f30a2be88e9b3ce38d2f59af040b667ad5d61f3 | |
parent | 6b2e2f2ccb549d99ea8c9054e21546cb951667eb (diff) | |
parent | 2e570d3762a412f87fff19ea4a30d60b171a6ea4 (diff) | |
download | Doxygen-2ff6bc1d172d0ab03f4164377786fa6c887e4854.zip Doxygen-2ff6bc1d172d0ab03f4164377786fa6c887e4854.tar.gz Doxygen-2ff6bc1d172d0ab03f4164377786fa6c887e4854.tar.bz2 |
Merge pull request #708 from albert-github/feature/bug_fortran_code_real
Fortran code coloring improvements (REAL and comment lines)
-rw-r--r-- | src/fortrancode.l | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/fortrancode.l b/src/fortrancode.l index f491acb..ef2b9cf 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -931,9 +931,17 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON endFontClass(); } /*-------- variable declaration ----------------------------------*/ +<Start>^{BS}"real"/[,:( ] { // real is a bit tricky as it is a data type but also a function. + yy_push_state(YY_START); + BEGIN(Declaration); + startFontClass("keywordtype"); + g_code->codify(yytext); + endFontClass(); + } <Start>{TYPE_SPEC}/[,:( ] { QCString typ = yytext; - typ = typ.lower(); + typ = removeRedundantWhiteSpace(typ.lower()); + if (QString(typ).startsWith("real")) YY_FTN_REJECT; if (typ == "type" || typ == "class" || typ == "procedure") inTypeDecl = 1; yy_push_state(YY_START); BEGIN(Declaration); @@ -1188,14 +1196,16 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON /*-----------------------------------------------------------------------------*/ <*>\n { - if (g_endComment) - { - g_endComment=FALSE; - } - else - { - codifyLines(yytext); - } + if (g_endComment) + { + g_endComment=FALSE; + } + else + { + codifyLines(yytext); + // comment cannot extend over the end of a line so should always be terminatd at the end of the line. + if (g_currentFontClass && !strcmp(g_currentFontClass,"comment")) endFontClass(); + } g_contLineNr++; YY_FTN_RESET } |