Skip to content

Commit d9049db

Browse files
committed
fix: cxx API generator
1 parent 78f298c commit d9049db

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/cxx-api/manual_test/.doxygen.config.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ INTERNAL_DOCS = NO
653653
# Possible values are: SYSTEM, NO and YES.
654654
# The default value is: SYSTEM.
655655

656-
CASE_SENSE_NAMES = SYSTEM
656+
CASE_SENSE_NAMES = YES
657657

658658
# If the HIDE_SCOPE_NAMES tag is set to NO then Doxygen will show members with
659659
# their full class and namespace scopes in the documentation. If set to YES, the

scripts/cxx-api/parser/builders.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,14 @@ def create_enum_scope(snapshot: Snapshot, enum_def: compound.EnumdefType) -> Non
605605
"""
606606
Create an enum scope in the snapshot.
607607
"""
608+
path = parse_qualified_path(enum_def.qualifiedname)
609+
parent_scope = snapshot.ensure_scope(path[0:-1])
610+
enum_name = path[-1]
611+
if enum_name in parent_scope.inner_scopes:
612+
existing = parent_scope.inner_scopes[enum_name]
613+
if existing.kind.name == "enum":
614+
return
615+
608616
scope = snapshot.create_enum(enum_def.qualifiedname)
609617
scope.kind.type = resolve_linked_text_name(enum_def.get_type())[0]
610618
scope.location = enum_def.location.file

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}"

scripts/cxx-api/tests/snapshots/.doxygen.config.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ INTERNAL_DOCS = NO
653653
# Possible values are: SYSTEM, NO and YES.
654654
# The default value is: SYSTEM.
655655

656-
CASE_SENSE_NAMES = SYSTEM
656+
CASE_SENSE_NAMES = YES
657657

658658
# If the HIDE_SCOPE_NAMES tag is set to NO then Doxygen will show members with
659659
# their full class and namespace scopes in the documentation. If set to YES, the

0 commit comments

Comments
 (0)