aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index a39cb94..d7d97e0 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -567,6 +567,19 @@ struct type *reverse_type_list(struct type *root)
return new_root;
}
+struct ast *filter_empty(struct ast *root)
+{
+ struct ast *ret = root;
+ while (root) {
+ if (root->n && root->n->k == AST_EMPTY)
+ root->n = root->n->n;
+
+ root = root->n;
+ }
+
+ return ret;
+}
+
void fix_closures(struct ast *root)
{
while (root) {