summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-09-23 06:13:44 (GMT)
committerWilliam Blevins <wblevins001@gmail.com>2016-09-23 06:13:44 (GMT)
commitd2312ff7f05636c425526936d1957464221b26d0 (patch)
treeb9e1870afd2bbb9196c559a48b18a9e37f398539 /src
parent2c18000b934722c69e23a2d0ad181767d5266ac9 (diff)
downloadSCons-d2312ff7f05636c425526936d1957464221b26d0.zip
SCons-d2312ff7f05636c425526936d1957464221b26d0.tar.gz
SCons-d2312ff7f05636c425526936d1957464221b26d0.tar.bz2
Initial python3 cut of test/Fortran.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Scanner/Fortran.py12
-rw-r--r--src/engine/SCons/Tool/FortranCommon.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py
index 1b55130..9082015 100644
--- a/src/engine/SCons/Scanner/Fortran.py
+++ b/src/engine/SCons/Scanner/Fortran.py
@@ -82,11 +82,11 @@ class F90Scanner(SCons.Scanner.Classic):
mods_and_includes = node.includes
else:
# retrieve all included filenames
- includes = self.cre_incl.findall(node.get_text_contents())
+ includes = self.cre_incl.findall(node.get_contents())
# retrieve all USE'd module names
- modules = self.cre_use.findall(node.get_text_contents())
+ modules = self.cre_use.findall(node.get_contents())
# retrieve all defined module names
- defmodules = self.cre_def.findall(node.get_text_contents())
+ defmodules = self.cre_def.findall(node.get_contents())
# Remove all USE'd module names that are defined in the same file
# (case-insensitively)
@@ -187,7 +187,7 @@ def FortranScan(path_variable="FORTRANPATH"):
# (\w+) : match the module name that is being USE'd
#
#
- use_regex = "(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"
+ use_regex = b"(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"
# The INCLUDE statement regex matches the following:
@@ -275,7 +275,7 @@ def FortranScan(path_variable="FORTRANPATH"):
# set of semicolon-separated INCLUDE statements
# (as allowed by the F2003 standard)
- include_regex = """(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
+ include_regex = b"(?i)(?:^|['\">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<\"'](.+?)(?=[\"'>])"
# The MODULE statement regex finds module definitions by matching
# the following:
@@ -299,7 +299,7 @@ def FortranScan(path_variable="FORTRANPATH"):
# that make up the defined module name and
# save it in a group
- def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"""
+ def_regex = b"(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"
scanner = F90Scanner("FortranScan",
"$FORTRANSUFFIXES",
diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py
index e450730..1503639 100644
--- a/src/engine/SCons/Tool/FortranCommon.py
+++ b/src/engine/SCons/Tool/FortranCommon.py
@@ -64,7 +64,7 @@ def _fortranEmitter(target, source, env):
if not node.exists() and not node.is_derived():
print("Could not locate " + str(node.name))
return ([], [])
- mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"""
+ mod_regex = b"(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"
cre = re.compile(mod_regex,re.M)
# Retrieve all USE'd module names
modules = cre.findall(node.get_text_contents())