aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-15 16:42:42 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-15 16:42:42 -0400
commit835eb7e89627eea923bfd57bdacba7065c6b1d4c (patch)
tree68fd9832252e728ccf0c7277a5a2f492e41c261c /environment.c
parentfb37b0ee4253651cab10b41cc2e1f536b17b26d4 (diff)
Add optional:or_exit(...)
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c8
1 files changed, 5 insertions, 3 deletions
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)}},