mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-03-12 07:32:30 +00:00
Make work under Hugs98 Sep2006. Falderal needs improving, though.
This commit is contained in:
parent
cfd99c69e2
commit
bd25d7b9f0
22
build.sh
22
build.sh
@ -1,3 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd src && mkdir -p ../bin && ghc Main.hs -o ../bin/sixtypical
|
||||
PROG=sixtypical
|
||||
|
||||
if [ x`which ghc` = x -a x`which runhugs` = x ]; then
|
||||
echo "Neither ghc nor runhugs found on search path."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p bin
|
||||
|
||||
if [ x`which ghc` = x -o ! x$USE_HUGS = x ]; then
|
||||
# create script to run with Hugs
|
||||
cat >bin/$PROG <<'EOF'
|
||||
#!/bin/sh
|
||||
THIS=`realpath $0`
|
||||
DIR=`dirname $THIS`/../src
|
||||
runhugs $DIR/Main.hs $*
|
||||
EOF
|
||||
chmod 755 bin/$PROG
|
||||
else
|
||||
cd src && ghc --make Main.hs -o ../bin/$PROG
|
||||
fi
|
||||
|
@ -170,19 +170,21 @@ Copy command: immediate -> word
|
||||
|
||||
Copy command: byte-sized immediate -> word
|
||||
|
||||
| reserve word position
|
||||
| routine main {
|
||||
| copy #1 position
|
||||
| }
|
||||
= main:
|
||||
= lda #1
|
||||
= sta position
|
||||
= lda #0
|
||||
= sta position+1
|
||||
= rts
|
||||
=
|
||||
= .data
|
||||
= .space position 2
|
||||
Disabled for now.
|
||||
|
||||
| reserve word position
|
||||
| routine main {
|
||||
| copy #1 position
|
||||
| }
|
||||
= main:
|
||||
= lda #1
|
||||
= sta position
|
||||
= lda #0
|
||||
= sta position+1
|
||||
= rts
|
||||
=
|
||||
= .data
|
||||
= .space position 2
|
||||
|
||||
Copy command: word -> word
|
||||
|
||||
|
@ -133,7 +133,10 @@ mergeRoutCtxs nm routCtx calledRoutCtx calledRout@(Routine name outputs _) =
|
||||
PoisonedWith ulocation ->
|
||||
updateRoutCtx nm location usage routCtxAccum
|
||||
in
|
||||
Map.foldrWithKey (poison) routCtx calledRoutCtx
|
||||
foldrWithKey (poison) routCtx calledRoutCtx
|
||||
where
|
||||
-- for Hugs Sep2006, which doesn't have Map.foldrWithKey
|
||||
foldrWithKey f z = foldr (uncurry f) z . Map.toAscList
|
||||
|
||||
--
|
||||
-- Utility function:
|
||||
@ -167,4 +170,7 @@ mergeAlternateRoutCtxs nm routCtx1 routCtx2 =
|
||||
in
|
||||
updateRoutCtx nm location newUsage routCtxAccum
|
||||
in
|
||||
Map.foldrWithKey (poison) routCtx1 routCtx2
|
||||
foldrWithKey (poison) routCtx1 routCtx2
|
||||
where
|
||||
-- for Hugs Sep2006, which doesn't have Map.foldrWithKey
|
||||
foldrWithKey f z = foldr (uncurry f) z . Map.toAscList
|
||||
|
Loading…
x
Reference in New Issue
Block a user