diff options
author | David Robillard <d@drobilla.net> | 2019-03-17 17:31:04 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-03-17 18:14:27 +0100 |
commit | 6547441f898cc55923878022960c79f33959c7b3 (patch) | |
tree | c1c4f72dd5ca4e9b5a833e386c96d79683f5eefd /waflib/Tools/fc_scan.py | |
parent | 556bb105e3877b9fa59f5829404386c02d146611 (diff) | |
parent | 388292beaecc981066c28359ab588b5056c9158a (diff) | |
download | fomp.lv2-master.tar.gz fomp.lv2-master.tar.bz2 fomp.lv2-master.zip |
Diffstat (limited to 'waflib/Tools/fc_scan.py')
-rw-r--r-- | waflib/Tools/fc_scan.py | 12 |
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): |