aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-07 00:44:47 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-07 00:44:47 -0400
commitcf7ea6fbef55e217da5289b80b6551737e534083 (patch)
tree4ad0a3754b32788e96bd4d9eedce2df1a8788992 /environment.c
parent2bc948567e51e2c79cc703968e59c4caccb4b176 (diff)
Add exit() function
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index 11304d2b..d09f0a65 100644
--- a/environment.c
+++ b/environment.c
@@ -42,6 +42,10 @@ env_t *new_compilation_unit(CORD *libname)
.next=new(arg_t, .name="force_tty", .type=Type(BoolType),
.default_val=FakeAST(Bool, true)))),
.ret=TEXT_TYPE)}},
+ {"exit", {.code="tomo_exit",
+ .type=Type(FunctionType, .args=new(arg_t, .name="message", .type=Type(TextType), .default_val=FakeAST(TextLiteral),
+ .next=new(arg_t, .name="code", .type=Type(IntType, .bits=TYPE_IBITS32),
+ .default_val=FakeAST(Int, .bits=IBITS32, .str="0"))), .ret=Type(AbortType))}},
{"fail", {.code="fail", .type=Type(FunctionType, .args=new(arg_t, .name="message", .type=Type(CStringType)), .ret=Type(AbortType))}},
{"USE_COLOR", {.code="USE_COLOR", .type=Type(BoolType)}},
};