diff options
author | martinw | 2001-02-14 14:35:23 +0000 |
---|---|---|
committer | martinw | 2001-02-14 14:35:23 +0000 |
commit | c2cf3760cf1da7d8fb92870eac1cd57776abcadb (patch) | |
tree | 7f6ea5e8f19b0f6c078deb254f6caee30aa8fdd8 | |
parent | just setting the switch for import syntax from "2.0" back to "1.3" (diff) |
bugfix: the algorithm couldn't handle applications that were (curried)
macros although their symb_kind was SK_Function (instead of SK_Macro)
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@296 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r-- | frontend/comparedefimp.icl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/frontend/comparedefimp.icl b/frontend/comparedefimp.icl index 7243ee6..5a759aa 100644 --- a/frontend/comparedefimp.icl +++ b/frontend/comparedefimp.icl @@ -49,7 +49,9 @@ import syntax, checksupport, compare_constructor, utilities, StdCompare , ec_function_conversions :: !Conversions , ec_main_dcl_module_n - :: !Int + :: !Int + , ec_dcl_macro_range + :: !IndexRange } :: ExpressionsCorrespondMonad @@ -225,7 +227,8 @@ compareMacrosWithConversion main_dcl_module_n conversions function_conversions m ec_error_admin = error_admin, ec_tc_state = tc_state, ec_untransformed = untransformed, ec_function_conversions = function_conversions, - ec_main_dcl_module_n = main_dcl_module_n } + ec_main_dcl_module_n = main_dcl_module_n, + ec_dcl_macro_range = macro_range } ec_state = iFoldSt (compareMacroWithConversion conversions macro_range.ir_from) macro_range.ir_from macro_range.ir_to ec_state {ec_icl_functions, ec_var_heap, ec_expr_heap, ec_error_admin, ec_tc_state} = ec_state @@ -817,7 +820,13 @@ e_corresponds_app_symb dcl_app_symb=:{symb_name, symb_kind=SK_Function dcl_glob_ ec_state #! main_dcl_module_n = ec_state.ec_main_dcl_module_n | dcl_glob_index.glob_module==main_dcl_module_n && icl_glob_index.glob_module==main_dcl_module_n - | ec_state.ec_function_conversions.[dcl_glob_index.glob_object]<>icl_glob_index.glob_object + # dcl_glob_object = dcl_glob_index.glob_object + is_indeed_a_macro = ec_state.ec_dcl_macro_range.ir_from <= dcl_glob_object + && dcl_glob_object < ec_state.ec_dcl_macro_range.ir_to + | is_indeed_a_macro + = continuation_for_possibly_twice_defined_macros + dcl_app_symb dcl_glob_object icl_app_symb icl_glob_index.glob_object ec_state + | ec_state.ec_function_conversions.[dcl_glob_object]<>icl_glob_index.glob_object = give_error symb_name ec_state = ec_state | dcl_glob_index<>icl_glob_index @@ -924,4 +933,3 @@ do_nothing ec_state give_error s ec_state = { ec_state & ec_error_admin = checkError s error_message ec_state.ec_error_admin } - |