Skip to content

Commit

Permalink
Added class/procedure vardefs to FORTRAN code highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
hansec committed May 5, 2014
1 parent e9b40bf commit dbd1985
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fortrancode.l
Expand Up @@ -688,7 +688,8 @@ NUM_TYPE (complex|integer|logical|real)
LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.)
KIND {ARGS}
CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR})
TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|PROCEDURE)
TYPE_PREFIX ((TYPE|CLASS|PROCEDURE){BS}"(")

INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|IMPURE|ELEMENTAL)
Expand Down Expand Up @@ -877,7 +878,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
endFontClass();
}
/*-------- variable declaration ----------------------------------*/
<Start>"type"{BS}"(" {
<Start>^{BS}{TYPE_PREFIX}/{ID} {
yy_push_state(YY_START);
BEGIN(TypeDecl);
startFontClass("keywordtype");
Expand Down

0 comments on commit dbd1985

Please sign in to comment.