refactor(ast): one file per ast_type -- UNSTABLE (3)

This commit is contained in:
Matteo Flebus 2026-01-15 15:53:56 +01:00
parent 68d8a1fd13
commit e3ec484621
9 changed files with 76 additions and 9 deletions

View file

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