diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-04 14:25:48 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-04 14:25:48 -0500 |
commit | 75fc567dfdb4a6500990d79dc3f167d3262a96c5 (patch) | |
tree | 868f2db398c9747629e689e48b4bef9fcb84baee /scope.c | |
parent | 82990fa60f657861e9f2709d68c971d08e9b513c (diff) |
nms . typing and fixing cgen for local namespaces
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -59,6 +59,9 @@ static void remove_ident_decls(Block *b, Declaration *d) { /* pass NULL for block for global scope */ static bool block_enter(Block *b, Statement *stmts, U16 flags) { + if (b && (b->flags & BLOCK_IS_NMS)) /* we only enter namespaces once, when they're created */ + return true; + bool ret = true; arr_foreach(stmts, Statement, stmt) { if (stmt->kind == STMT_DECL) { @@ -71,6 +74,9 @@ static bool block_enter(Block *b, Statement *stmts, U16 flags) { } static void block_exit(Block *b, Statement *stmts) { + if (b && (b->flags & BLOCK_IS_NMS)) + return; + arr_foreach(stmts, Statement, stmt) { if (stmt->kind == STMT_DECL) { Declaration *decl = &stmt->decl; |