|
16 | 16 | """
|
17 | 17 | import pprint
|
18 | 18 | import sys
|
| 19 | +import re |
19 | 20 | import types
|
20 | 21 | from functools import reduce
|
21 | 22 |
|
|
26 | 27 | 'applyrules', 'debugcapi', 'dictappend', 'errmess', 'gentitle',
|
27 | 28 | 'getargs2', 'getcallprotoargument', 'getcallstatement',
|
28 | 29 | 'getfortranname', 'getpymethoddef', 'getrestdoc', 'getusercode',
|
29 |
| - 'getusercode1', 'hasbody', 'hascallstatement', 'hascommon', |
| 30 | + 'getusercode1', 'getdimension', 'hasbody', 'hascallstatement', 'hascommon', |
30 | 31 | 'hasexternals', 'hasinitvalue', 'hasnote', 'hasresultnote',
|
31 | 32 | 'isallocatable', 'isarray', 'isarrayofstrings',
|
32 | 33 | 'ischaracter', 'ischaracterarray', 'ischaracter_or_characterarray',
|
@@ -417,6 +418,13 @@ def isexternal(var):
|
417 | 418 | return 'attrspec' in var and 'external' in var['attrspec']
|
418 | 419 |
|
419 | 420 |
|
| 421 | +def getdimension(var): |
| 422 | + dimpattern = r"\((.*?)\)" |
| 423 | + if 'attrspec' in var.keys(): |
| 424 | + if any('dimension' in s for s in var['attrspec']): |
| 425 | + return [re.findall(dimpattern, v) for v in var['attrspec']][0] |
| 426 | + |
| 427 | + |
420 | 428 | def isrequired(var):
|
421 | 429 | return not isoptional(var) and isintent_nothide(var)
|
422 | 430 |
|
|
0 commit comments