summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-04-22 09:11:10 (GMT)
committerGitHub <noreply@github.com>2018-04-22 09:11:10 (GMT)
commit96b8b8533c9efb61fc1ba5c42a3ba0f010dd391a (patch)
tree5409b83f9e4f5580e0913de996fd2d267668fff2
parent7e2fcd305c8c9377aa958a3d812cc31bc81c0e32 (diff)
parent4013e52ba0f87eb12f8a1c8cb3b2714c0d519a81 (diff)
downloadDoxygen-96b8b8533c9efb61fc1ba5c42a3ba0f010dd391a.zip
Doxygen-96b8b8533c9efb61fc1ba5c42a3ba0f010dd391a.tar.gz
Doxygen-96b8b8533c9efb61fc1ba5c42a3ba0f010dd391a.tar.bz2
Merge pull request #658 from albert-github/feature/bug_fortran_2
Fortran improvements (2)
-rw-r--r--src/fortrancode.l49
-rw-r--r--src/fortranscanner.l5
2 files changed, 34 insertions, 20 deletions
diff --git a/src/fortrancode.l b/src/fortrancode.l
index 501b492..1ad184f 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -159,6 +159,9 @@ static char stringStartSymbol; // single or double quote
// declared from referenced names
static int bracketCount = 0;
+// signal when in type / class /procedure declaration
+static int inTypeDecl = 0;
+
static bool g_endComment;
static void endFontClass()
@@ -813,7 +816,8 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
unput(*yytext);
yy_pop_state();YY_FTN_RESET
}
-<Start>"import"{BS_} {
+<*>"import"{BS}/"\n" |
+<*>"import"{BS_} {
startFontClass("keywordtype");
codifyLines(yytext);
endFontClass();
@@ -825,6 +829,11 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
generateLink(*g_code, yytext);
g_insideBody=FALSE;
}
+<Import>("ONLY"|"NONE"|"ALL") {
+ startFontClass("keywordtype");
+ codifyLines(yytext);
+ endFontClass();
+ }
/*-------- fortran module -----------------------------------------*/
<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n { //
startScope();
@@ -836,14 +845,14 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
if (!qstricmp(yytext,"module")) currentModule="module";
}
<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n { //
- startScope();
- startFontClass("keyword");
- codifyLines(yytext);
- endFontClass();
+ startScope();
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
yy_push_state(YY_START);
- BEGIN(ClassName);
- currentClass="class";
- }
+ BEGIN(ClassName);
+ currentClass="class";
+ }
<ClassName>{ID} {
if (currentModule == "module")
{
@@ -876,7 +885,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
codifyLines(yytext);
endFontClass();
}
-<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found
+<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
@@ -923,6 +932,9 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
}
/*-------- variable declaration ----------------------------------*/
<Start>{TYPE_SPEC}/[,:( ] {
+ QCString typ = yytext;
+ typ = typ.lower();
+ if (typ == "type" || typ == "class" || typ == "procedure") inTypeDecl = 1;
yy_push_state(YY_START);
BEGIN(Declaration);
startFontClass("keywordtype");
@@ -946,7 +958,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
g_code->codify(yytext);
endFontClass();
}
- else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine"))) ||
+ else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine") || inTypeDecl)) ||
g_currentMemberDef->isVariable()))
{
generateLink(*g_code, yytext);
@@ -956,22 +968,23 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
g_code->codify(yytext);
addLocalVar(yytext);
}
- }
-<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
- BEGIN(DeclarationBinding);
- g_code->codify(yytext);
- }
-<DeclarationBinding>{ID} { // Type bound procedure link
+ }
+<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
+ BEGIN(DeclarationBinding);
+ g_code->codify(yytext);
+ }
+<DeclarationBinding>{ID} { // Type bound procedure link
generateLink(*g_code, yytext);
yy_pop_state();
- }
-<Declaration>[(] { // start of array specification
+ }
+<Declaration>[(] { // start of array or type / class specification
bracketCount++;
g_code->codify(yytext);
}
<Declaration>[)] { // end array specification
bracketCount--;
+ if (!bracketCount) inTypeDecl = 0;
g_code->codify(yytext);
}
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 85b6de9..ca071cf 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -602,7 +602,7 @@ abstract {
current->spec |= Entry::AbstractClass;
}
extends{ARGS} {
- QCString basename = extractFromParens(yytext);
+ QCString basename = extractFromParens(yytext).lower();
current->extends->append(new BaseInfo(basename, Public, Normal));
}
public {
@@ -667,7 +667,8 @@ private {
addCurrentEntry(1);
}
{BS}"=>"[^(\n|\!)]* { /* Specific bindings come after the ID. */
- last_entry->args = yytext;
+ QCString args = yytext;
+ last_entry->args = args.lower();
}
"\n" {
currentModifiers = SymbolModifiers();