Commit efb18a2c authored by Oriol Tintó-Prims's avatar Oriol Tintó-Prims
Browse files

Fixing find_call_in_original_file, which had problems when the arguments started with a - sign.

parent 6ebed1fb
......@@ -63,12 +63,13 @@ def find_call_in_original_file(routine, argument, argument_index, _file, target_
target_type = "wp"
new_argument = "REAL(%s, %s)" % (m.group(1), target_type)
# Fix the pattern to account for regex rules
pattern = r"\b%s\b####\b%s" % (routine, argument)
pattern = r"\b%s\b####$$$$%s" % (routine, argument)
pattern = pattern.replace("(", "\(")
pattern = pattern.replace(")", "\)")
pattern = pattern.replace("+", "\+")
pattern = pattern.replace("*", "\*")
pattern = pattern.replace("####", ".*")
pattern = pattern.replace("$$$$", "(\b|, *)")
pattern += r"(\b|[, )])"
# Initialize found to False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment