summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 1b116b7..1f3f687 100644
--- a/scope.c
+++ b/scope.c
@@ -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;