aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/Tools/fc_scan.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 18:43:09 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 19:02:31 +0100
commitca9f746af500be98f7c65b7f1bd0f50ad936a8b6 (patch)
tree789465df66ea327e642c3e80d690ed7e4a38b1a6 /waflib/Tools/fc_scan.py
parenta7860f7e495583f536480a7cce2b6e0c55926f3a (diff)
parentb2ca9626b290e8ab5bfa6269dfc7afe64a012ce1 (diff)
downloadlv2-ca9f746af500be98f7c65b7f1bd0f50ad936a8b6.tar.xz
Update autowaf and adapt to new API
Diffstat (limited to 'waflib/Tools/fc_scan.py')
-rw-r--r--waflib/Tools/fc_scan.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/waflib/Tools/fc_scan.py b/waflib/Tools/fc_scan.py
index 12cb0fc..0824c92 100644
--- a/waflib/Tools/fc_scan.py
+++ b/waflib/Tools/fc_scan.py
@@ -5,13 +5,15 @@
import re
-INC_REGEX = """(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
-USE_REGEX = """(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
-MOD_REGEX = """(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
+INC_REGEX = r"""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
+USE_REGEX = r"""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
+MOD_REGEX = r"""(?:^|;)\s*MODULE(?!\s+(?:PROCEDURE|SUBROUTINE|FUNCTION))\s+(\w+)"""
+SMD_REGEX = r"""(?:^|;)\s*SUBMODULE\s*\(([\w:]+)\)\s*(\w+)"""
re_inc = re.compile(INC_REGEX, re.I)
re_use = re.compile(USE_REGEX, re.I)
re_mod = re.compile(MOD_REGEX, re.I)
+re_smd = re.compile(SMD_REGEX, re.I)
class fortran_parser(object):
"""
@@ -58,6 +60,10 @@ class fortran_parser(object):
m = re_mod.search(line)
if m:
mods.append(m.group(1))
+ m = re_smd.search(line)
+ if m:
+ uses.append(m.group(1))
+ mods.append('{0}:{1}'.format(m.group(1),m.group(2)))
return (incs, uses, mods)
def start(self, node):