aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-03 21:14:17 -0500
committerMustafa Quraish <[email protected]>2022-02-03 21:14:17 -0500
commit0a5c4e6954a6969120b0854650357ca95f9c9fdc (patch)
treee791a039829c3ac4dbb4250a54f1a0cc8e7ff6ff /src
parentModify implementation of structs to support unions (diff)
downloadcup-0a5c4e6954a6969120b0854650357ca95f9c9fdc.tar.xz
cup-0a5c4e6954a6969120b0854650357ca95f9c9fdc.zip
Add `exit()` syscall builtin
Diffstat (limited to 'src')
-rw-r--r--src/builtins.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/builtins.c b/src/builtins.c
index 2883c1d..45f203d 100644
--- a/src/builtins.c
+++ b/src/builtins.c
@@ -69,6 +69,9 @@ void initialize_builtins()
make_syscall(3, SYS_read, "read", type_new(TYPE_INT),
type_new(TYPE_INT), type_new_ptr(TYPE_CHAR), type_new(TYPE_INT) // Args
);
+ make_syscall(1, SYS_exit, "exit", type_new(TYPE_NONE),
+ type_new(TYPE_INT) // Args
+ );
}
Node *find_builtin_function(Token *token)