on master help sign in
added LChInt LIntCh to primitives
commit1dc8f399083ee52d7508ecceeefe77ce4482579c authorraichoo <raichoo@googlemail.com> dateFri 18 Jan 2013, 18:49 (14 years ago) parentc1420f0
3 files changed+5−3
src/IRTS/CodegenC.hs+2 src/IRTS/Lang.hs+1−1 src/Idris/Primitives.hs+2−2
src/IRTS/CodegenC.hs+2
@@ -322,5 +322,7 @@ doOp v LStdErr [] = v ++ "MKPTR(vm, stderr)"
322322doOp v LFork [x] = v ++ "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
323323doOp v LPar [x] = v ++ creg x -- "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
324324doOp v LVMPtr [] = v ++ "MKPTR(vm, vm)"
325+doOp v LChInt args = v ++ creg (last args)
326+doOp v LIntCh args = v ++ creg (last args)
325327doOp v LNoOp args = v ++ creg (last args)
326328doOp _ _ _ = "FAIL"
src/IRTS/Lang.hs+1−1
@@ -37,7 +37,7 @@ data PrimFn = LPlus | LMinus | LTimes | LDiv | LMod
3737 | LBEq | LBLt | LBLe | LBGt | LBGe
3838 | LStrConcat | LStrLt | LStrEq | LStrLen
3939 | LIntFloat | LFloatInt | LIntStr | LStrInt | LFloatStr | LStrFloat
40− | LIntBig | LBigInt | LStrBig | LBigStr
40+ | LIntBig | LBigInt | LStrBig | LBigStr | LChInt | LIntCh
4141 | LPrintNum | LPrintStr | LReadStr
4242
4343 | LW8 | LW16
src/Idris/Primitives.hs+2−2
@@ -144,9 +144,9 @@ primitives =
144144 Prim (UN "prim__intToStr") (ty [IType] StrType) 1 (c_intToStr)
145145 (1, LIntStr) total,
146146 Prim (UN "prim__charToInt") (ty [ChType] IType) 1 (c_charToInt)
147− (1, LNoOp) total,
147+ (1, LChInt) total,
148148 Prim (UN "prim__intToChar") (ty [IType] ChType) 1 (c_intToChar)
149− (1, LNoOp) total,
149+ (1, LIntCh) total,
150150 Prim (UN "prim__intToBigInt") (ty [IType] BIType) 1 (c_intToBigInt)
151151 (1, LIntBig) total,
152152 Prim (UN "prim__bigIntToInt") (ty [BIType] IType) 1 (c_bigIntToInt)