all repos — hex @ cb73bf43edede5c886b5eb26a2215d09a9384005

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

Fixes.
h3rald h3rald@h3rald.com
Sun, 01 Dec 2024 09:18:02 +0000
commit

cb73bf43edede5c886b5eb26a2215d09a9384005

parent

19dc382da83df50e0e5606211c82f21d89532261

1 files changed, 3 insertions(+), 5 deletions(-)

jump to
M hex.chex.c

@@ -542,11 +542,10 @@ break;

} else if (*ptr == '\n') { - hex_error(ctx, "Unescaped new line in string"); - token->value = "<newline>"; token->type = HEX_TOKEN_INVALID; token->position.line = position->line; token->position.column = position->column; + hex_error(ctx, "(%d,%d) Unescaped new line in string", position->line, position->column); return token; } else

@@ -559,11 +558,10 @@ }

if (*ptr != '"') { - hex_error(ctx, "Unterminated string"); token->type = HEX_TOKEN_INVALID; - token->value = strdup(ptr); token->position.line = position->line; token->position.column = position->column; + hex_error(ctx, "(%d,%d) Unterminated string", position->line, position->column); return token; }

@@ -822,7 +820,7 @@

// Print the stack trace void print_stack_trace(hex_context_t *ctx) { - if (!ctx->settings.stack_trace_enabled || !ctx->settings.errors_enabled) + if (!ctx->settings.stack_trace_enabled || !ctx->settings.errors_enabled || ctx->stack_trace.size <= 0) { return; }