#include "scirpt/ast.h" #include void scirpt_ast_expr_delete(ScirptAstExpr* expr) { switch (expr->type) { case ScirptAstExprTypeEof: break; case ScirptAstExprTypeError: break; case ScirptAstExprTypeId: heapstring_destroy(&expr->id_value); break; case ScirptAstExprTypeInt: break; case ScirptAstExprTypeString: heapstring_destroy(&expr->string_value); break; case ScirptAstExprTypeBool: break; case ScirptAstExprTypeNull: break; case ScirptAstExprTypeBlock: scirpt_ast_expr_array_destroy(&expr->block.statements); scirpt_ast_expr_delete(expr->block.value); break; case ScirptAstExprTypeIf: scirpt_ast_expr_delete(expr->if_expr.condition); scirpt_ast_expr_delete(expr->if_expr.truthy); scirpt_ast_expr_delete(expr->if_expr.falsy); break; } }