about summary refs log tree commit diff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/stdlib.src10
1 files changed, 10 insertions, 0 deletions
diff --git a/std/stdlib.src b/std/stdlib.src
index 004c249..90e28d6 100644
--- a/std/stdlib.src
+++ b/std/stdlib.src
@@ -1,4 +1,5 @@
 extern printf = (*i8, varargs) => void;
+extern exit = (i64) => void;
 
 /* TODO: This has a bug (with varargs i think) */
 let println = (str: *i8, args: varargs) => void {
@@ -78,3 +79,12 @@ let iswhitespace = (c: i8) => bool {
 
 	return false;
 };
+
+let assert = (cond: bool) => void {
+	if !cond {
+		println("UNREACHABLE");
+		exit(1);
+	};
+
+	return;
+};