feat(ast): ast_function
This commit is contained in:
parent
f31fca4204
commit
a550f9747e
4 changed files with 78 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue