]> git.lizzy.rs Git - uwu-lang.git/blob - std/ref.c
Argument counting starts at 1 now
[uwu-lang.git] / std / ref.c
1 #include "common/err.h"
2 #include "api/ref.h"
3 #include "api/util.h"
4
5 UwUVMValue uwu_call(UwUVMArgs *args)
6 {
7         uwuutil_require_min(":ref:call", args, 1);
8
9         UwUVMValue value = uwuvm_get_arg(args, 0);
10
11         if (value.type != &uwuref_type)
12                 error(":ref:call requires a function reference as $1\n");
13
14         return uwuvm_call_function(value.data, args->num - 1, &args->unevaluated[1], args->super);
15 }
16
17 UwUVMValue uwu_is(UwUVMArgs *args)
18 {
19         return uwuutil_is_type(":ref:is", args, &uwuref_type);
20 }