aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/bool.c1
-rw-r--r--std/int.c2
-rw-r--r--std/nil.c10
3 files changed, 11 insertions, 2 deletions
diff --git a/std/bool.c b/std/bool.c
index 80aade5..76772bf 100644
--- a/std/bool.c
+++ b/std/bool.c
@@ -9,7 +9,6 @@ static inline bool get_bool_arg(UwUVMArgs *args, size_t i)
return uwubool_get(uwuvm_get_arg(args, i));
}
-#include "../api/str.h"
UwUVMValue uwu_if(UwUVMArgs *args)
{
if (args->num != 3)
diff --git a/std/int.c b/std/int.c
index 48c808b..dfc436c 100644
--- a/std/int.c
+++ b/std/int.c
@@ -80,7 +80,7 @@ static int reduce(const char *fnname, UwUVMArgs *args, ReduceOP op, int result)
UwUVMValue uwu_add(UwUVMArgs *args)
{
- return uwuint_create(reduce(":int:mul", args, ROP_ADD, 0));
+ return uwuint_create(reduce(":int:add", args, ROP_ADD, 0));
}
UwUVMValue uwu_sub(UwUVMArgs *args)
diff --git a/std/nil.c b/std/nil.c
new file mode 100644
index 0000000..33230fb
--- /dev/null
+++ b/std/nil.c
@@ -0,0 +1,10 @@
+#include "../src/err.h"
+#include "../api/nil.h"
+
+UwUVMValue uwu_nil(UwUVMArgs *args)
+{
+ if (args->num != 0)
+ error(":nil:nil does not accept any arguments\n");
+
+ return uwunil_create();
+}