@@ -50,39 +50,40 @@ def find_value_type(global_ns, value_type_str):
50
50
name = value_type_str ,
51
51
function = lambda decl : not isinstance (decl , calldef .calldef_t ),
52
52
allow_empty = True )
53
- if not found :
54
- no_global_ns_value_type_str = value_type_str [2 :]
55
- if no_global_ns_value_type_str in cpptypes .FUNDAMENTAL_TYPES :
56
- return cpptypes .FUNDAMENTAL_TYPES [no_global_ns_value_type_str ]
57
- elif type_traits .is_std_string (value_type_str ):
58
- string_ = global_ns .typedef ('::std::string' )
59
- return type_traits .remove_declarated (string_ )
60
- elif type_traits .is_std_wstring (value_type_str ):
61
- string_ = global_ns .typedef ('::std::wstring' )
62
- return type_traits .remove_declarated (string_ )
53
+
54
+ if len (found ) == 1 :
55
+ return found [0 ]
56
+
57
+ no_global_ns_value_type_str = value_type_str [2 :]
58
+ if no_global_ns_value_type_str in cpptypes .FUNDAMENTAL_TYPES :
59
+ return cpptypes .FUNDAMENTAL_TYPES [no_global_ns_value_type_str ]
60
+ elif type_traits .is_std_string (value_type_str ):
61
+ string_ = global_ns .typedef ('::std::string' )
62
+ return type_traits .remove_declarated (string_ )
63
+ elif type_traits .is_std_wstring (value_type_str ):
64
+ string_ = global_ns .typedef ('::std::wstring' )
65
+ return type_traits .remove_declarated (string_ )
66
+ else :
67
+ value_type_str = no_global_ns_value_type_str
68
+ has_const = value_type_str .startswith ('const ' )
69
+ if has_const :
70
+ value_type_str = value_type_str [len ('const ' ):]
71
+ has_pointer = value_type_str .endswith ('*' )
72
+ if has_pointer :
73
+ value_type_str = value_type_str [:- 1 ]
74
+ found = None
75
+ if has_const or has_pointer :
76
+ found = impl_details .find_value_type (
77
+ global_ns ,
78
+ value_type_str )
79
+ if not found :
80
+ return None
63
81
else :
64
- value_type_str = no_global_ns_value_type_str
65
- has_const = value_type_str . startswith ( 'const ' )
82
+ if isinstance ( found , class_declaration . class_types ):
83
+ return cpptypes . declarated_t ( found )
66
84
if has_const :
67
- value_type_str = value_type_str [len ('const ' ):]
68
- has_pointer = value_type_str .endswith ('*' )
85
+ return cpptypes .const_t (found )
69
86
if has_pointer :
70
- value_type_str = value_type_str [:- 1 ]
71
- found = None
72
- if has_const or has_pointer :
73
- found = impl_details .find_value_type (
74
- global_ns ,
75
- value_type_str )
76
- if not found :
77
- return None
78
- else :
79
- if isinstance (found , class_declaration .class_types ):
80
- return cpptypes .declarated_t (found )
81
- if has_const :
82
- return cpptypes .const_t (found )
83
- if has_pointer :
84
- return cpptypes .pointer_t (found )
85
- if len (found ) == 1 :
86
- return found [0 ]
87
+ return cpptypes .pointer_t (found )
87
88
88
89
return None
0 commit comments