summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-10-11 15:19:54 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-10-11 15:19:54 (GMT)
commit258259fff03a8cb0347b0ddc9f04676ab6833572 (patch)
tree230ea360638b5594645a0e27f06d7a0c5a14ad4e
parent7290439e50fbce00d9e99928799f0faf560444ef (diff)
parent6da2e3fb28f6ed9f219c66d165ac4467fda36148 (diff)
downloadDoxygen-258259fff03a8cb0347b0ddc9f04676ab6833572.zip
Doxygen-258259fff03a8cb0347b0ddc9f04676ab6833572.tar.gz
Doxygen-258259fff03a8cb0347b0ddc9f04676ab6833572.tar.bz2
Merge pull request #235 from albert-github/feature/bug_738063
Bug 738063 - Fortran attribute contiguous not identified
-rw-r--r--src/fortrancode.l2
-rw-r--r--src/fortranscanner.l26
2 files changed, 25 insertions, 3 deletions
diff --git a/src/fortrancode.l b/src/fortrancode.l
index 03baeed..ac6a73b 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -694,7 +694,7 @@ 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|CLASS|PROCEDURE)
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|VALUE|NOPASS|DEFERRED)
+ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE)
ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
/* Assume that attribute statements are almost the same as attributes. */
ATTR_STMT {ATTR_SPEC}|DIMENSION
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 8ea8aeb..8415e43 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -99,13 +99,15 @@ struct SymbolModifiers {
bool nonoverridable;
bool nopass;
bool pass;
+ bool contiguous;
+ bool volat; /* volatile is a reserverd name */
QCString passVar;
SymbolModifiers() : type(), returnName(), protection(NONE_P), direction(NONE_D),
optional(FALSE), protect(FALSE), dimension(), allocatable(FALSE),
external(FALSE), intrinsic(FALSE), parameter(FALSE),
pointer(FALSE), target(FALSE), save(FALSE), deferred(FALSE), nonoverridable(FALSE),
- nopass(FALSE), pass(FALSE), passVar() {}
+ nopass(FALSE), pass(FALSE), contiguous(FALSE), volat(FALSE), passVar() {}
SymbolModifiers& operator|=(const SymbolModifiers &mdfs);
SymbolModifiers& operator|=(QCString mdfrString);
@@ -258,7 +260,7 @@ 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 (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{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|CONTIGUOUS|VOLATILE)
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. */
@@ -1572,6 +1574,8 @@ SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs)
nopass |= mdfs.nopass;
pass |= mdfs.pass;
passVar = mdfs.passVar;
+ contiguous |= mdfs.contiguous;
+ volat |= mdfs.volat;
return *this;
}
@@ -1650,6 +1654,14 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString)
{
newMdf.nonoverridable = TRUE;
}
+ else if (mdfString=="contiguous")
+ {
+ newMdf.contiguous = TRUE;
+ }
+ else if (mdfString=="volatile")
+ {
+ newMdf.volat = TRUE;
+ }
else if (mdfString.contains("pass"))
{
newMdf.pass = TRUE;
@@ -1804,6 +1816,16 @@ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs)
if (!typeName.isEmpty()) typeName += ", ";
typeName += "protected";
}
+ if (mdfs.contiguous)
+ {
+ if (!typeName.isEmpty()) typeName += ", ";
+ typeName += "contiguous";
+ }
+ if (mdfs.volat)
+ {
+ if (!typeName.isEmpty()) typeName += ", ";
+ typeName += "volatile";
+ }
return typeName;
}