Commit 9cf9a2aa authored by John van Groningen's avatar John van Groningen
Browse files

refactor, replace function uniquenessError, that was always called with a...

refactor, replace function uniquenessError, that was always called with a CP_Expression with a FreeVar, by function uniquenessErrorFreeVar
parent 04fdbf74
......@@ -1007,21 +1007,21 @@ where
= (CT_Existential, tree)
uniquenessErrorVar :: !FreeVar !FunctionBody !String !*ErrorAdmin -> *ErrorAdmin
uniquenessErrorVar free_var=:{fv_info_ptr} (TransformedBody {tb_args,tb_rhs}) mess err
uniquenessErrorVar {fv_info_ptr,fv_ident} (TransformedBody {tb_args,tb_rhs}) mess err
| var_in_free_vars fv_info_ptr tb_args
= uniquenessError (CP_Expression (FreeVar free_var)) mess err
= uniquenessErrorFreeVar fv_ident mess err
# position = find_var_position_in_expression fv_info_ptr tb_rhs
= case position of
LinePos file_name line_n
# ea_file = err.ea_file <<< "Uniqueness error " <<< {sp_file=file_name,sp_line=line_n,sp_name=free_var.fv_ident.id_name} <<< '\"' <<< mess <<< '\n'
-> { err & ea_file = ea_file, ea_ok = False}
# ea_file = err.ea_file <<< "Uniqueness error " <<< {sp_file=file_name,sp_line=line_n,sp_name=fv_ident.id_name} <<< '\"' <<< mess <<< '\n'
-> {err & ea_file = ea_file, ea_ok = False}
_
-> uniquenessError (CP_Expression (FreeVar free_var)) mess err
-> uniquenessErrorFreeVar fv_ident mess err
uniquenessError :: !CoercionPosition !String !*ErrorAdmin -> *ErrorAdmin
uniquenessError position mess err=:{ea_file,ea_loc=[{ep_ident,ep_position}:_]}
# ea_file = ea_file <<< "Uniqueness error " <<< stringPosition ep_ident.id_name ep_position <<< ": \"" <<< position <<< '\"' <<< mess <<< '\n'
= { err & ea_file = ea_file, ea_ok = False}
uniquenessErrorFreeVar :: !Ident !String !*ErrorAdmin -> *ErrorAdmin
uniquenessErrorFreeVar ident mess err=:{ea_file,ea_loc=[{ep_ident,ep_position}:_]}
# ea_file = ea_file <<< "Uniqueness error " <<< stringPosition ep_ident.id_name ep_position <<< ": \"" <<< ident <<< '\"' <<< mess <<< '\n'
= {err & ea_file = ea_file, ea_ok = False}
var_in_free_vars var_ptr []
= False
......
Supports Markdown
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