diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-18 22:25:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-18 22:25:09 -0800 |
| commit | a80575608e0296e1779c2085b893145893e4cc20 (patch) | |
| tree | 3521c2b5e646a2728859e177d09820119d4819bb /source/slang | |
| parent | abeb3758f35a48c2012dd3c39d704409c679a652 (diff) | |
Check decl nesting for namespaces. (#5910)
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-parser.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 5554724a7..10dbe3140 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -4634,14 +4634,6 @@ static void CompleteDecl( ContainerDecl* containerDecl, Modifiers modifiers) { - - // If this is a namespace and already added, we don't want to add to the parent - // Or add any modifiers - if (as<NamespaceDecl>(decl) && decl->parentDecl) - { - return; - } - // Add any modifiers we parsed before the declaration to the list // of modifiers on the declaration itself. // @@ -4699,6 +4691,13 @@ static void CompleteDecl( } } + // If this is a namespace and already added, we don't want to add to the parent + // Or add any modifiers + if (as<NamespaceDecl>(decl) && decl->parentDecl) + { + return; + } + if (!as<GenericDecl>(containerDecl)) { // Make sure the decl is properly nested inside its lexical parent |
