diff options
Diffstat (limited to 'Sjit/Compile.icl')
-rw-r--r-- | Sjit/Compile.icl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Sjit/Compile.icl b/Sjit/Compile.icl index 5e4cef5..96db7f2 100644 --- a/Sjit/Compile.icl +++ b/Sjit/Compile.icl @@ -102,6 +102,7 @@ compile f cs where expr :: !Expr !CompileState -> Either String (![Instr], !CompileState) expr (Int i) cs = Right ([PushI i], {cs & sp=cs.sp+1, pc=cs.pc+1}) + expr (Bool b) cs = Right ([PushI (if b 1 0)], {cs & sp=cs.sp+1, pc=cs.pc+1}) expr (Var v) cs = case get v cs.vars of Just i -> Right ([PushRef (i-cs.sp)], {cs & sp=cs.sp+1, pc=cs.pc+1}) Nothing -> Left ("undefined variable '" +++ v +++ "'") |