all repos — hex @ a0220a3a1d57e82b0876c17842aec8c8db3a80ce

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Implemented symbol throw
Fabio Cevasco h3rald@h3rald.com
Mon, 23 Dec 2024 13:17:04 +0100
commit

a0220a3a1d57e82b0876c17842aec8c8db3a80ce

parent

b44e5fd120743a570fb75c503e949b569c1a2641

1 files changed, 18 insertions(+), 0 deletions(-)

jump to
M src/symbols.csrc/symbols.c

@@ -2323,6 +2323,24 @@ }

return 0; } +int hex_symbol_throw(hex_context_t *ctx) +{ + HEX_POP(ctx, message); + if (message.type == HEX_TYPE_INVALID) + { + HEX_FREE(ctx, message); + return 1; + } + if (message.type != HEX_TYPE_STRING) + { + hex_error(ctx, "[symbol throw] String required"); + HEX_FREE(ctx, message); + return 1; + } + hex_error(ctx, message.data.str_value); + return 1; +} + // Quotation symbols int hex_symbol_q(hex_context_t *ctx)