all repos — hex @ 7c0cbf18d70292d8a381177a324811cc73618423

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

Now freeing tokens associated to symbols.
h3rald h3rald@h3rald.com
Sun, 24 Nov 2024 18:13:04 +0000
commit

7c0cbf18d70292d8a381177a324811cc73618423

parent

a8d4d5a215d13a184b8e6e918d60d6e8e97fbf32

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

jump to
M hex.chex.c

@@ -429,6 +429,7 @@ hex_debug_element(" POP", HEX_STACK[HEX_TOP]);

return HEX_STACK[HEX_TOP--]; } +void hex_free_token(HEX_Token *token); void hex_debug(const char *format, ...); char *hex_type(HEX_ElementType type);

@@ -459,11 +460,15 @@ else if (element.type == HEX_TYPE_NATIVE_SYMBOL && element.symbolName != NULL)

{ free(element.symbolName); element.symbolName = NULL; + hex_free_token(element.token); + element.token = NULL; } else if (element.type == HEX_TYPE_USER_SYMBOL && element.symbolName != NULL) { free(element.symbolName); element.symbolName = NULL; + hex_free_token(element.token); + element.token = NULL; } }