From cf7ea6fbef55e217da5289b80b6551737e534083 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 7 Sep 2024 00:44:47 -0400 Subject: Add exit() function --- environment.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'environment.c') 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)}}, }; -- cgit v1.2.3