refactor(ast): one file per ast_type -- FINISHED

This commit is contained in:
Matteo Flebus 2026-01-15 17:12:06 +01:00
parent 38f5a35885
commit 30df2993ee
10 changed files with 85 additions and 51 deletions

View file

@ -31,14 +31,15 @@ bool ast_is_if(struct ast *node)
return node->type == AST_IF;
}
void ast_free_if(struct ast_if *if_data)
void ast_free_if(struct ast_if **if_data)
{
if (if_data == NULL)
if (if_data == NULL || *if_data == NULL)
return;
ast_free(if_data->condition);
ast_free(if_data->then_clause);
ast_free(if_data->else_clause);
ast_free((*if_data)->condition);
ast_free((*if_data)->then_clause);
ast_free((*if_data)->else_clause);
free(if_data);
free(*if_data);
*if_data = NULL;
}