diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-08 14:32:22 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-08 14:32:22 -0400 |
commit | 6075f33768b3a160fa1a06e54253f9cd565241ec (patch) | |
tree | 9b399a7e2686f8eaa61d36d9782f030be1f045b5 /scope.c | |
parent | 9c4be69bbd707e96eec176cad4188dcba265eb4c (diff) |
eval fn calling (eval is done./runv)
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -54,3 +54,18 @@ static void block_exit(Block *b, Statement *stmts) { } } } + +/* does NOT enter function's block body */ +static void fn_enter(FnExpr *f) { + arr_foreach(f->params, Declaration, decl) + add_ident_decls(&f->body, decl); + arr_foreach(f->ret_decls, Declaration, decl) + add_ident_decls(&f->body, decl); +} + +static void fn_exit(FnExpr *f) { + arr_foreach(f->params, Declaration, decl) + remove_ident_decls(&f->body, decl); + arr_foreach(f->ret_decls, Declaration, decl) + remove_ident_decls(&f->body, decl); +} |