Skip to content

Commit 09683c8

Browse files
committed
fix: indempotent CXX API parser for nested enums
1 parent 15c11bd commit 09683c8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scripts/cxx-api/parser/snapshot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ def create_enum(self, qualified_name: str) -> Scope[EnumScopeKind]:
184184
scope = current_scope.inner_scopes[enum_name]
185185
if scope.kind.name == "temporary":
186186
scope.kind = EnumScopeKind()
187+
elif scope.kind.name == "enum":
188+
return scope
187189
else:
188190
raise RuntimeError(
189191
f"Identifier {enum_name} already exists in scope {current_scope.name}"

0 commit comments

Comments
 (0)