X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskInterpret.icl;h=0f68ed27a0c00d20064adfef02c45709f0cedcd9;hb=6e3b45dd6cef95c1577a91b15a1256fa4b06ca88;hp=0ab4508c6fbf006aa1aa48b6cf5aad5c212af3fc;hpb=8449be73c124cdccd37500c0d67d9404b94fc9c8;p=mTask.git diff --git a/mTaskInterpret.icl b/mTaskInterpret.icl index 0ab4508..0f68ed2 100644 --- a/mTaskInterpret.icl +++ b/mTaskInterpret.icl @@ -69,7 +69,7 @@ bclength _ = 1 toByteVal :: BC -> [Char] toByteVal b -# bt = toChar $ consIndex{|*|} b + 1 +# bt = toChar $ consIndex{|*|} b = [bt:case b of (BCPush i) = i (BCLab i) = [toChar i] @@ -159,7 +159,7 @@ BCIfStmt b t e = b <++> retrn [BCJmpF else] <++> t <++> retrn [BCJmp endif,BCLab else] <++> e <++> retrn [BCLab endif] -instance noOp ByteCode where noOp = mempty +instance noOp ByteCode where noOp = retrn [BCNop] withLabel :: (Int -> (ByteCode b q)) -> ByteCode b q withLabel f = BC \s->let [fresh:fs] = s.freshl