diff options
author | johnvg | 2011-09-06 09:46:48 +0000 |
---|---|---|
committer | johnvg | 2011-09-06 09:46:48 +0000 |
commit | 9b0c8596c6b9785285604c081243e24360ddfbfe (patch) | |
tree | 4586b3bea1b5ea7b21210a5720066a1ad961b99b | |
parent | remove unused constructor PE_Field of type ParsedExpr (diff) |
move mapSt2 and mapY2St from module check to module utilities
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1968 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r-- | frontend/check.icl | 22 | ||||
-rw-r--r-- | frontend/utilities.dcl | 22 | ||||
-rw-r--r-- | frontend/utilities.icl | 22 |
3 files changed, 44 insertions, 22 deletions
diff --git a/frontend/check.icl b/frontend/check.icl index 52ddbb1..17991e4 100644 --- a/frontend/check.icl +++ b/frontend/check.icl @@ -603,28 +603,6 @@ where = (list_of_specials, next_inst_index, all_instances, type_heaps, predef_symbols, error) check_instance_specials mod_index fun_type fun_index SP_None next_inst_index all_instances type_heaps predef_symbols error = (SP_None, next_inst_index, all_instances, type_heaps, predef_symbols,error) - -mapSt2 f l s1 s2 :== map_st2 l s1 s2 -where - map_st2 [x : xs] s1 s2 - # (x, s1,s2) = f x s1 s2 - (xs, s1,s2) = map_st2 xs s1 s2 - #! s1 = s1 - #! s2 = s2 - = ([x : xs], s1,s2) - map_st2 [] s1 s2 - = ([], s1,s2) - -mapY2St f l s :== map_y2_st l s -where - map_y2_st [x : xs] s - # (x, y, s) = f x s - (xs, ys, s) = map_y2_st xs s - #! s = s - = ([x : xs], [y : ys], s) - map_y2_st [] s - #! s = s - = ([], [], s) checkAndCollectTypesOfContextsOfSpecials :: [TypeContext] *PredefinedSymbols *ErrorAdmin -> (![[Type]],!*PredefinedSymbols,!*ErrorAdmin); checkAndCollectTypesOfContextsOfSpecials type_contexts predef_symbols error diff --git a/frontend/utilities.dcl b/frontend/utilities.dcl index 8ffad4f..63d7135 100644 --- a/frontend/utilities.dcl +++ b/frontend/utilities.dcl @@ -37,6 +37,28 @@ where #! s = s = ([], s) +mapSt2 f l s1 s2 :== map_st2 l s1 s2 +where + map_st2 [x : xs] s1 s2 + # (x, s1,s2) = f x s1 s2 + (xs, s1,s2) = map_st2 xs s1 s2 + #! s1 = s1 + #! s2 = s2 + = ([x : xs], s1,s2) + map_st2 [] s1 s2 + = ([], s1,s2) + +mapY2St f l s :== map_y2_st l s +where + map_y2_st [x : xs] s + # (x, y, s) = f x s + (xs, ys, s) = map_y2_st xs s + #! s = s + = ([x : xs], [y : ys], s) + map_y2_st [] s + #! s = s + = ([], [], s) + map2St f l1 l2 st :== map2_st l1 l2 st where map2_st [h1:t1] [h2:t2] st diff --git a/frontend/utilities.icl b/frontend/utilities.icl index de046af..848c2f7 100644 --- a/frontend/utilities.icl +++ b/frontend/utilities.icl @@ -140,6 +140,28 @@ where #! s = s = ([], s) +mapSt2 f l s1 s2 :== map_st2 l s1 s2 +where + map_st2 [x : xs] s1 s2 + # (x, s1,s2) = f x s1 s2 + (xs, s1,s2) = map_st2 xs s1 s2 + #! s1 = s1 + #! s2 = s2 + = ([x : xs], s1,s2) + map_st2 [] s1 s2 + = ([], s1,s2) + +mapY2St f l s :== map_y2_st l s +where + map_y2_st [x : xs] s + # (x, y, s) = f x s + (xs, ys, s) = map_y2_st xs s + #! s = s + = ([x : xs], [y : ys], s) + map_y2_st [] s + #! s = s + = ([], [], s) + map2St f l1 l2 st :== map2_st l1 l2 st where map2_st [h1:t1] [h2:t2] st |