diff options
Diffstat (limited to 'decls_cgen.c')
-rw-r--r-- | decls_cgen.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/decls_cgen.c b/decls_cgen.c index 19eb0bc..f07b17e 100644 --- a/decls_cgen.c +++ b/decls_cgen.c @@ -73,11 +73,9 @@ static bool cgen_decls_decl(CGenerator *g, Declaration *d) { if (!cgen_fn_header(g, &d->expr.fn, d->where, 0, 0)) return false; cgen_write(g, ";"); - cgen_nl(g); + fn_exit(&d->expr.fn); } - if (!cgen_decls_block(g, &d->expr.fn.body)) - return false; - fn_exit(&d->expr.fn); + cgen_recurse_subexprs(g, (&d->expr), cgen_decls_expr, cgen_decls_block, cgen_decls_decl); } else if (d->flags & DECL_HAS_EXPR) { if (d->flags & DECL_IS_CONST) { for (size_t idx = 0; idx < arr_len(d->idents); idx++) { |