aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorjohnvg2008-01-03 11:00:40 +0000
committerjohnvg2008-01-03 11:00:40 +0000
commit00a4a91911442512e4b752c9b6c28962974162c7 (patch)
tree0bf706f9de40b49748f2c271111f41d44f80cbc8 /frontend
parentmake function has_observing_type faster (diff)
move function remove_first_n from backendinterface to containers
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1696 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend')
-rw-r--r--frontend/containers.dcl1
-rw-r--r--frontend/containers.icl19
2 files changed, 20 insertions, 0 deletions
diff --git a/frontend/containers.dcl b/frontend/containers.dcl
index de787d6..f0da996 100644
--- a/frontend/containers.dcl
+++ b/frontend/containers.dcl
@@ -37,6 +37,7 @@ add_next_strict :: !Int !Int !StrictnessList -> (!Int,!Int,!StrictnessList)
add_next_not_strict :: !Int !Int !StrictnessList -> (!Int,!Int,!StrictnessList)
append_strictness :: !Int !StrictnessList -> StrictnessList
first_n_are_strict :: !Int !StrictnessList -> Bool
+remove_first_n :: !Int !StrictnessList -> StrictnessList
:: IntKey :== Int
diff --git a/frontend/containers.icl b/frontend/containers.icl
index 4d0282b..6b1cd08 100644
--- a/frontend/containers.icl
+++ b/frontend/containers.icl
@@ -351,6 +351,25 @@ first_n_are_strict n (StrictList s l)
# m=(1<<n)-1
= s bitand m==m
+remove_first_n :: !Int !StrictnessList -> StrictnessList
+remove_first_n 0 s
+ = s
+remove_first_n _ NotStrict
+ = NotStrict
+remove_first_n n (Strict s)
+ | n<32
+ = Strict (((s>>1) bitand 0x7fffffff)>>(n-1))
+ = NotStrict
+remove_first_n n (StrictList s l)
+ | n<32
+ # s2=case l of
+ Strict s -> s
+ StrictList s _ -> s
+ NotStrict -> 0
+ # s=(((s>>1) bitand 0x7fffffff)>>(n-1)) bitor (s2<<(32-n))
+ = StrictList s (remove_first_n n l)
+ = remove_first_n (n-32) l
+
screw :== 80
:: IntKey :== Int