diff options
author | Camil Staps | 2018-12-25 01:54:02 +0100 |
---|---|---|
committer | Camil Staps | 2018-12-25 01:54:02 +0100 |
commit | f8c9564372709e0634c9eb0c208ec9cc31a93de7 (patch) | |
tree | 4092e07b7e341150639491f2b0b4c32a65be2be3 /Sjit/Run.icl | |
parent | Better use of monads (diff) |
Add if construct; fib example
Diffstat (limited to 'Sjit/Run.icl')
-rw-r--r-- | Sjit/Run.icl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Sjit/Run.icl b/Sjit/Run.icl index b5858ec..e3e623f 100644 --- a/Sjit/Run.icl +++ b/Sjit/Run.icl @@ -23,6 +23,10 @@ where [val:stack] -> exec (i+1) (take (n-1) stack ++ [val:drop n stack]) Pop n -> exec (i+1) (drop n stack) Call f -> exec f [i+1:stack] + Jmp f -> exec f stack + JmpTrue f -> case stack of + [0:stack] -> exec (i+1) stack + [_:stack] -> exec f stack Ret -> case stack of [ret:stack] -> exec ret stack Halt -> case stack of |