Fixes.
h3rald h3rald@h3rald.com
Sun, 01 Dec 2024 09:18:02 +0000
1 files changed,
3 insertions(+),
5 deletions(-)
jump to
M
hex.c
→
hex.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; }