feat(ast): ast_function

This commit is contained in:
matteo 2026-01-31 11:57:51 +01:00
parent f31fca4204
commit a550f9747e
4 changed files with 78 additions and 3 deletions

View file

@ -11,7 +11,7 @@ void ast_free(struct ast **node)
{
if (node == NULL || *node == NULL)
{
perror(
fprintf(stderr,
"WARNING: Internal error: failed to free AST node (NULL argument)");
return;
}
@ -48,12 +48,15 @@ void ast_free(struct ast **node)
case AST_LOOP:
ast_free_loop(ast_get_loop(*node));
break;
case AST_FUNCTION:
ast_free_function(ast_get_function(*node));
break;
case AST_VOID:
case AST_END:
break;
default:
perror("WARNING: Internal error: failed to free an AST node (Unknown "
fprintf(stderr, "WARNING: Internal error: failed to free an AST node (Unknown "
"type)");
return;
}