mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-09-21 18:32:44 +03:00
Add believe_me and crash primitives to refc
This commit is contained in:
parent
3007b5a99d
commit
97e5f04c34
@ -242,6 +242,8 @@ cOp StrIndex [x, i] = "strIndex(" ++ x ++ ", " ++ i ++ ")"
|
||||
cOp StrCons [x, y] = "strCons(" ++ x ++ ", " ++ y ++ ")"
|
||||
cOp StrAppend [x, y] = "strAppend(" ++ x ++ ", " ++ y ++ ")"
|
||||
cOp StrSubstr [x, y, z] = "strSubstr(" ++ x ++ ", " ++ y ++ ", " ++ z ++ ")"
|
||||
cOp BelieveMe [_, _, x] = x
|
||||
cOp Crash [_, msg] = "idris2_crash(" ++ msg ++ ");"
|
||||
cOp fn args = plainOp (show fn) (toList args)
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <unistd.h>
|
||||
#include "prim.h"
|
||||
|
||||
Value *Prelude_IO_prim__getChar(Value *world)
|
||||
@ -91,6 +92,14 @@ Value *sysOS(void)
|
||||
return (Value *)makeString("Other");
|
||||
#endif
|
||||
}
|
||||
|
||||
Value* idris2_crash(Value* msg) {
|
||||
Value_String* str = (Value_String*)msg;
|
||||
printf("ERROR: %s\n", str->str);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
@ -16,6 +16,7 @@ Value *writeIORef(Value *, Value *, Value *, Value *);
|
||||
// Sys
|
||||
|
||||
Value *sysOS(void);
|
||||
Value* idris2_crash(Value* msg);
|
||||
|
||||
// Array
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user