repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove traces
[mTask.git]
/
mTaskInterpret.icl
diff --git
a/mTaskInterpret.icl
b/mTaskInterpret.icl
index
0ab4508
..
7a2559f
100644
(file)
--- a/
mTaskInterpret.icl
+++ b/
mTaskInterpret.icl
@@
-27,6
+27,7
@@
encode (MTSds i v) = "s" +++ to16bit i +++ v +++ "\n"
encode (MTTask to data) = "t" +++ to16bit to +++ to16bit (size data) +++ data +++ "\n"
encode (MTUpd i v) = "u" +++ to16bit i +++ v +++ "\n"
encode (MTTask to data) = "t" +++ to16bit to +++ to16bit (size data) +++ data +++ "\n"
encode (MTUpd i v) = "u" +++ to16bit i +++ v +++ "\n"
+import StdDebug
decode :: String -> MTaskMSGRecv
decode x
| size x == 0 = MTEmpty
decode :: String -> MTaskMSGRecv
decode x
| size x == 0 = MTEmpty
@@
-69,7
+70,7
@@
bclength _ = 1
toByteVal :: BC -> [Char]
toByteVal b
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]
= [bt:case b of
(BCPush i) = i
(BCLab i) = [toChar i]
@@
-159,7
+160,7
@@
BCIfStmt b t e =
b <++> retrn [BCJmpF else] <++> t
<++> retrn [BCJmp endif,BCLab else] <++> e <++> retrn [BCLab endif]
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
withLabel :: (Int -> (ByteCode b q)) -> ByteCode b q
withLabel f = BC \s->let [fresh:fs] = s.freshl