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

[Issue#86]: Fix if is an external funcion, not working completely

parent b135dcfc
......@@ -39,6 +39,7 @@ def get_variable(contents, routine=None, vault=None):
raise Error.VariableNotFound
if contents.count("%val"):
contents = contents.replace("%val", "")
return get_variable(contents, routine=routine, vault=vault)
if contents.count("%"):
try:
return get_structure_member(contents, routine, vault=vault)
......@@ -381,6 +382,7 @@ def get_type_of_contents(contents, routine=None, vault=None):
contents = contents.replace(" ", "").strip()
is_a_function_not_found = False
if CallManager.is_call_to_function(contents):
fun_name = CallManager.find_called_function(contents)
if fun_name in vault.intrinsics:
......@@ -417,7 +419,7 @@ def get_type_of_contents(contents, routine=None, vault=None):
else:
return fun.type
except Error.ProcedureNotFound:
pass
is_a_function_not_found = True
# warnings.warn("If its a function should be on the library or an intrinsic, isn't it? %s|nLooking if its a variable... " % contents)
# return type_of_contents(fun_name, routine=routine, vault=vault)
......@@ -488,9 +490,12 @@ def get_type_of_contents(contents, routine=None, vault=None):
if re.search(r"^\w+$", abs_content):
try:
var = vault.get_variable(abs_content, routine=routine)
return var.type
except Error.VariableNotFound:
raise Error.VariableNotFound
return var.type
if is_a_function_not_found:
pass
else:
raise Error.VariableNotFound
if contents.count(">") or contents.count("<") or contents.count("=="):
return "logical"
......
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