Skip to content

Commit

Permalink
fix: ignore namespace qualifiers in type names
Browse files Browse the repository at this point in the history
  • Loading branch information
Makcal committed May 4, 2024
1 parent a783bbb commit 1b41c21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp_to_plantuml/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _parse_class(self, cursor: cindex.Cursor):
if node.kind in self.CLASS_KINDS:
self._parse_class(node)
elif node.kind == cindex.CursorKind.CXX_BASE_SPECIFIER:
cls.base_classes.append(node.displayname)
cls.base_classes.append(node.displayname.rpartition('::')[2])
elif node.kind in self.VAR_KINDS:
cls.fields.append(self._parse_field(node))
elif node.kind in self.METHOD_KINDS:
Expand All @@ -99,7 +99,7 @@ def _parse_var_type(cursor: cindex.Cursor) -> str:
type_ += t
else:
type_ = cursor.type.spelling
return type_
return type_.rpartition('::')[2]

@classmethod
def _parse_function_type(cls, cursor: cindex.Cursor) -> str:
Expand All @@ -120,7 +120,7 @@ def _parse_function_type(cls, cursor: cindex.Cursor) -> str:
type_ += t
else:
type_ = cursor.result_type.spelling
return type_
return type_.rpartition('::')[2]

@classmethod
def _parse_field(cls, cursor: cindex.Cursor) -> CppField:
Expand Down

0 comments on commit 1b41c21

Please sign in to comment.