on master help sign in
added LChInt LIntCh to primitives
1dc8f39raichoo
src/IRTS/CodegenC.hs+2
@@ -322,5 +322,7 @@ doOp v LStdErr [] = v ++ "MKPTR(vm, stderr)"
322doOp v LFork [x] = v ++ "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
322doOp v LFork [x] = v ++ "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
323doOp v LPar [x] = v ++ creg x -- "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
323doOp v LPar [x] = v ++ creg x -- "MKPTR(vm, vmThread(vm, " ++ cname (MN 0 "EVAL") ++ ", " ++ creg x ++ "))"
324doOp v LVMPtr [] = v ++ "MKPTR(vm, vm)"
324doOp v LVMPtr [] = v ++ "MKPTR(vm, vm)"
325+doOp v LChInt args = v ++ creg (last args)
326+doOp v LIntCh args = v ++ creg (last args)
325doOp v LNoOp args = v ++ creg (last args)
327doOp v LNoOp args = v ++ creg (last args)
326doOp _ _ _ = "FAIL"
328doOp _ _ _ = "FAIL"
src/IRTS/Lang.hs+1−1
@@ -37,7 +37,7 @@ data PrimFn = LPlus | LMinus | LTimes | LDiv | LMod
37 | LBEq | LBLt | LBLe | LBGt | LBGe
37 | LBEq | LBLt | LBLe | LBGt | LBGe
38 | LStrConcat | LStrLt | LStrEq | LStrLen
38 | LStrConcat | LStrLt | LStrEq | LStrLen
39 | LIntFloat | LFloatInt | LIntStr | LStrInt | LFloatStr | LStrFloat
39 | LIntFloat | LFloatInt | LIntStr | LStrInt | LFloatStr | LStrFloat
40− | LIntBig | LBigInt | LStrBig | LBigStr
40+ | LIntBig | LBigInt | LStrBig | LBigStr | LChInt | LIntCh
41 | LPrintNum | LPrintStr | LReadStr
41 | LPrintNum | LPrintStr | LReadStr
42
42
43 | LW8 | LW16
43 | LW8 | LW16
src/Idris/Primitives.hs+2−2
@@ -144,9 +144,9 @@ primitives =
144 Prim (UN "prim__intToStr") (ty [IType] StrType) 1 (c_intToStr)
144 Prim (UN "prim__intToStr") (ty [IType] StrType) 1 (c_intToStr)
145 (1, LIntStr) total,
145 (1, LIntStr) total,
146 Prim (UN "prim__charToInt") (ty [ChType] IType) 1 (c_charToInt)
146 Prim (UN "prim__charToInt") (ty [ChType] IType) 1 (c_charToInt)
147− (1, LNoOp) total,
147+ (1, LChInt) total,
148 Prim (UN "prim__intToChar") (ty [IType] ChType) 1 (c_intToChar)
148 Prim (UN "prim__intToChar") (ty [IType] ChType) 1 (c_intToChar)
149− (1, LNoOp) total,
149+ (1, LIntCh) total,
150 Prim (UN "prim__intToBigInt") (ty [IType] BIType) 1 (c_intToBigInt)
150 Prim (UN "prim__intToBigInt") (ty [IType] BIType) 1 (c_intToBigInt)
151 (1, LIntBig) total,
151 (1, LIntBig) total,
152 Prim (UN "prim__bigIntToInt") (ty [BIType] IType) 1 (c_bigIntToInt)
152 Prim (UN "prim__bigIntToInt") (ty [BIType] IType) 1 (c_bigIntToInt)