Commit 8a89d70a authored by sparonuz's avatar sparonuz
Browse files

[Issue#77]: Added check to avoid matching line with an assignation instead of a function call

parent de763304
......@@ -344,6 +344,10 @@ def find_subprogram_call(subprogram_call, argument_index, original_modules):
line = BasicFunctions.merge_line_range(original_module.lines, indices[0] + index)
line = BasicFunctions.remove_comments(line)
line = BasicFunctions.remove_if_else_condition(line)
# Avoid matching when the variable is on one side of the equation and the function on the other
assignation = re.search(RegexPattern.assignation, line, re.I)
if assignation:
line = assignation.group(3)
if re.search(subprogram_pattern % subprogram_name, line, re.I):
# The function is found: check is a call with all the arguments to fix
arg_found = [ag for ag in argument_names if re.search(RegexPattern.escape_string(ag), line, re.I)]
......
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