summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2014-09-07 11:06:49 (GMT)
committeralbert-github <albert.tests@gmail.com>2014-09-07 11:06:49 (GMT)
commit8f78eff7e8b2650f9a8364ff5c5b6925279e6b5a (patch)
treeeb874c5e2cbb5a757ca27e46eab825c6a619fbdc
parentaf14bab65f67d66b65f2ddf5c5d76a96f23cd447 (diff)
downloadDoxygen-8f78eff7e8b2650f9a8364ff5c5b6925279e6b5a.zip
Doxygen-8f78eff7e8b2650f9a8364ff5c5b6925279e6b5a.tar.gz
Doxygen-8f78eff7e8b2650f9a8364ff5c5b6925279e6b5a.tar.bz2
Bug 634763 - Fortran: external subroutine as dummy argument not recognized
Besides as as attribute the external can also be used as "type" Previous commit (pull request 121) was reverted (pull request 122) due to warning message.
-rw-r--r--src/fortranscanner.l24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 765f887..8ea8aeb 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -258,11 +258,12 @@ 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{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?)
INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
-ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE)
+ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE)
ACCESS_SPEC (PRIVATE|PUBLIC)
LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
/* Assume that attribute statements are almost the same as attributes. */
ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
+EXTERNAL_STMT (EXTERNAL)
CONTAINS CONTAINS
PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)?
@@ -726,6 +727,18 @@ private {
}
}
*/
+{EXTERNAL_STMT}/({BS}"::"|{BS_}{ID}) {
+ /* external can be a "type" or an attribute */
+ if(YY_START == Start)
+ {
+ addModule(NULL);
+ yy_push_state(ModuleBody); //anon program
+ }
+ QCString tmp = yytext;
+ currentModifiers |= tmp.stripWhiteSpace();
+ argType = QCString(yytext).simplifyWhiteSpace().lower();
+ yy_push_state(AttributeList);
+ }
{ATTR_STMT}/{BS_}{ID} |
{ATTR_STMT}/{BS}"::" {
/* attribute statement starts */
@@ -744,7 +757,7 @@ private {
<AttributeList>{
{COMMA} {}
{BS} {}
-{ATTR_SPEC}. { /* update current modifierswhen it is an ATTR_SPEC and not a variable name */
+{ATTR_SPEC}. { /* update current modifiers when it is an ATTR_SPEC and not a variable name */
/* bug_625519 */
QChar chr = yytext[(int)yyleng-1];
if (chr.isLetter() || chr.isDigit() || (chr == '_'))
@@ -1723,8 +1736,11 @@ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs)
}
if (mdfs.external)
{
- if (!typeName.isEmpty()) typeName += ", ";
- typeName += "external";
+ if (!typeName.contains("external"))
+ {
+ if (!typeName.isEmpty()) typeName += ", ";
+ typeName += "external";
+ }
}
if (mdfs.intrinsic)
{