From 3350b49826dcdf046835ec70a954122e1c21855d Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 4 Feb 2020 17:51:40 -0500 Subject: more namespaces --- scope.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scope.c') diff --git a/scope.c b/scope.c index 1f3f687..ed70875 100644 --- a/scope.c +++ b/scope.c @@ -58,16 +58,16 @@ 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; - +static bool block_enter(Block *b, Statement *stmts, U16 flags) { bool ret = true; arr_foreach(stmts, Statement, stmt) { if (stmt->kind == STMT_DECL) { Declaration *decl = &stmt->decl; if (!add_ident_decls(b, decl, flags)) ret = false; + } else if (stmt->kind == STMT_INCLUDE) { + if (!block_enter(b, stmt->inc.stmts, flags)) + return false; } } return ret; -- cgit v1.2.3