From bac1fc7844857d1928f4ded2448df3018f4f7f20 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 25 Dec 2018 02:18:27 +0100 Subject: Inline +, *, - and / --- Sjit/Run.icl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Sjit/Run.icl') diff --git a/Sjit/Run.icl b/Sjit/Run.icl index e3e623f..ad03e02 100644 --- a/Sjit/Run.icl +++ b/Sjit/Run.icl @@ -33,14 +33,14 @@ where [r] -> r _ -> abort (toString (length stack) +++ " values left on stack\n") - IAddRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a+b:stack] - IMulRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a*b:stack] - ISubRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a-b:stack] - IDivRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a/b:stack] + IAdd -> case stack of + [a:b:stack] -> exec (i+1) [a+b:stack] + IMul -> case stack of + [a:b:stack] -> exec (i+1) [a*b:stack] + ISub -> case stack of + [a:b:stack] -> exec (i+1) [a-b:stack] + IDiv -> case stack of + [a:b:stack] -> exec (i+1) [a/b:stack] get_program :: !CompileState -> Program get_program cs -- cgit v1.2.3