|
15 | 15 | parse_type_with_argstrings, |
16 | 16 | qualify_arguments, |
17 | 17 | qualify_parsed_type, |
18 | | - qualify_type_str, |
19 | 18 | split_specialization, |
20 | 19 | ) |
21 | | -from .base import Member, MemberKind, STORE_INITIALIZERS_IN_SNAPSHOT |
| 20 | +from .base import ( |
| 21 | + is_function_pointer_argstring, |
| 22 | + Member, |
| 23 | + MemberKind, |
| 24 | + STORE_INITIALIZERS_IN_SNAPSHOT, |
| 25 | +) |
22 | 26 |
|
23 | 27 | if TYPE_CHECKING: |
24 | 28 | from ..scope import Scope |
@@ -65,20 +69,7 @@ def member_kind(self) -> MemberKind: |
65 | 69 | def close(self, scope: Scope): |
66 | 70 | self._fp_arguments = qualify_arguments(self._fp_arguments, scope) |
67 | 71 | self._parsed_type = qualify_parsed_type(self._parsed_type, scope) |
68 | | - if self.specialization_args is not None: |
69 | | - self.specialization_args = [ |
70 | | - qualify_type_str(arg, scope) for arg in self.specialization_args |
71 | | - ] |
72 | | - |
73 | | - def _is_function_pointer(self) -> bool: |
74 | | - """Check if this variable is a function pointer type.""" |
75 | | - return self.argstring is not None and self.argstring.startswith(")(") |
76 | | - |
77 | | - def _get_qualified_name(self, qualification: str | None) -> str: |
78 | | - name = self.name |
79 | | - if self.specialization_args is not None: |
80 | | - name = f"{name}<{', '.join(self.specialization_args)}>" |
81 | | - return f"{qualification}::{name}" if qualification else name |
| 72 | + self._qualify_specialization_args(scope) |
82 | 73 |
|
83 | 74 | def to_string( |
84 | 75 | self, |
@@ -108,7 +99,7 @@ def to_string( |
108 | 99 | if self.is_const and not self.is_constexpr: |
109 | 100 | result += "const " |
110 | 101 |
|
111 | | - if self._is_function_pointer(): |
| 102 | + if is_function_pointer_argstring(self.argstring): |
112 | 103 | formatted_args = format_arguments(self._fp_arguments) |
113 | 104 | qualified_type = format_parsed_type(self._parsed_type) |
114 | 105 | # Function pointer types: argstring is ")(args...)" |
|
0 commit comments