@@ -167,9 +167,9 @@ int fix_fortran_dims(Node *n, const char *tmap_name, String *typemap) {
167
167
}
168
168
169
169
/* -------------------------------------------------------------------------
170
- * \brief Determine whether to wrap an enum as a value .
170
+ * \brief Determine whether to wrap an enum as a fortran parameter .
171
171
*/
172
- bool is_native_enum (Node *n) {
172
+ bool is_native_enum_decl (Node *n) {
173
173
String *enum_feature = Getattr (n, " feature:fortran:const" );
174
174
if (!enum_feature) {
175
175
// Determine from enum values
@@ -2897,7 +2897,7 @@ int FORTRAN::enumDeclaration(Node *n) {
2897
2897
2898
2898
// Determine whether to add enum as a native fortran enumeration. If false,
2899
2899
// the values are all wrapped as constants. Only create the list if values are defined.
2900
- bool is_native = is_native_enum (n) && firstChild (n);
2900
+ bool is_native = is_native_enum_decl (n) && firstChild (n);
2901
2901
2902
2902
// Check all enum values and update their names
2903
2903
for (Node *c = firstChild (n); c; c = nextSibling (c)) {
@@ -3021,25 +3021,25 @@ int FORTRAN::callbackfunctionHandler(Node *n) {
3021
3021
* and enum values.
3022
3022
*
3023
3023
* - Native enum values will become enumerators
3024
- * - Constants marked with `%fortranconst` will be rendered as *named constants*
3025
3024
* - Non-native enum values become C-bound external constants
3025
+ * - Constants marked with `%fortranconst` will be rendered as *named constants*
3026
3026
* - Constants marked with `%fortranbindc` also become C-bound external constants
3027
3027
* - All other types will generate `getter` functions that return native fortran types.
3028
3028
*/
3029
3029
int FORTRAN::constantWrapper (Node *n) {
3030
3030
enum {
3031
3031
NATIVE_ENUM,
3032
- NATIVE_CONSTANT,
3033
3032
EXTERN_ENUM,
3033
+ NATIVE_CONSTANT,
3034
3034
EXTERN_CONSTANT
3035
3035
} constant_type;
3036
3036
3037
3037
if (d_enum_public) {
3038
3038
constant_type = NATIVE_ENUM;
3039
- } else if (GetFlag (n, " feature:fortran:const" ) || Getattr (n, " feature:fortran:constvalue" )) {
3040
- constant_type = NATIVE_CONSTANT;
3041
3039
} else if (Cmp (nodeType (n), " enumitem" ) == 0 ) {
3042
3040
constant_type = EXTERN_ENUM;
3041
+ } else if (GetFlag (n, " feature:fortran:const" ) || Getattr (n, " feature:fortran:constvalue" )) {
3042
+ constant_type = NATIVE_CONSTANT;
3043
3043
} else if (GetFlag (n, " feature:fortran:bindc" ) && has_constant_storage (n)) {
3044
3044
constant_type = EXTERN_CONSTANT;
3045
3045
} else {
0 commit comments