From 835eb7e89627eea923bfd57bdacba7065c6b1d4c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Sep 2024 16:42:42 -0400 Subject: Add optional:or_exit(...) --- environment.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'environment.c') diff --git a/environment.c b/environment.c index 6810f37a..10aa0b58 100644 --- a/environment.c +++ b/environment.c @@ -42,9 +42,11 @@ env_t *new_compilation_unit(CORD *libname) .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))}}, + .type=Type(FunctionType, .args=new( + arg_t, .name="message", .type=Type(OptionalType, .type=Type(TextType)), + .default_val=FakeAST(Null, .type=new(type_ast_t, .tag=VarTypeAST, .__data.VarTypeAST.name="Text")), + .next=new(arg_t, .name="code", .type=Type(IntType, .bits=TYPE_IBITS32), + .default_val=FakeAST(Int, .bits=IBITS32, .str="1"))), .ret=Type(AbortType))}}, {"fail", {.code="fail", .type=Type(FunctionType, .args=new(arg_t, .name="message", .type=Type(CStringType)), .ret=Type(AbortType))}}, {"sleep", {.code="sleep_num", .type=Type(FunctionType, .args=new(arg_t, .name="seconds", .type=Type(NumType, .bits=TYPE_NBITS64)), .ret=Type(VoidType))}}, {"USE_COLOR", {.code="USE_COLOR", .type=Type(BoolType)}}, -- cgit v1.2.3