From 558697792cd062b93e8d7b7904fb9897e5f70750 Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Mon, 5 May 2014 16:23:17 -0400 Subject: Added import keyword to FORTRAN code highlighting --- src/fortrancode.l | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/fortrancode.l b/src/fortrancode.l index 2fbde73..06f712a 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -716,6 +716,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I %x DocBlock %x Use %x UseOnly +%x Import %x TypeDecl %x Declaration %x DeclContLine @@ -791,19 +792,32 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I yy_push_state(YY_START); BEGIN(UseOnly); } -{BS},{BS} { codifyLines(yytext); } -{BS}&{BS}"\n" { codifyLines(yytext); YY_FTN_RESET} +{BS},{BS} { codifyLines(yytext); } +{BS}&{BS}"\n" { codifyLines(yytext); YY_FTN_RESET} {ID} { g_insideBody=TRUE; generateLink(*g_code, yytext); g_insideBody=FALSE; useEntry->onlyNames.append(yytext); } -"\n" { +"\n" { unput(*yytext); yy_pop_state();YY_FTN_RESET } - +"import"{BS_} { + startFontClass("keywordflow"); + codifyLines(yytext); + endFontClass(); + yy_push_state(YY_START); + BEGIN(Import); + } +{ID} { + QCString tmp = yytext; + tmp = tmp.lower(); + g_insideBody=TRUE; + generateLink(*g_code, yytext); + g_insideBody=FALSE; + } /*-------- fortran module -----------------------------------------*/ ("block"{BS}"data"|"program"|"module"|"type"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n { // startScope(); -- cgit v0.12 From d8221cb7a73efc8f20068636c3d2fec84ce8cb8b Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Mon, 5 May 2014 16:27:35 -0400 Subject: Fixed keyword type --- src/fortrancode.l | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fortrancode.l b/src/fortrancode.l index 06f712a..b2991f5 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -805,15 +805,13 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I yy_pop_state();YY_FTN_RESET } "import"{BS_} { - startFontClass("keywordflow"); + startFontClass("keywordtype"); codifyLines(yytext); endFontClass(); yy_push_state(YY_START); BEGIN(Import); } {ID} { - QCString tmp = yytext; - tmp = tmp.lower(); g_insideBody=TRUE; generateLink(*g_code, yytext); g_insideBody=FALSE; -- cgit v0.12