@@ -2058,6 +2058,9 @@ struct function_type_node
2058
2058
return false ;
2059
2059
}
2060
2060
2061
+ auto nth_parameter_type_name (int n) const
2062
+ -> std::string;
2063
+
2061
2064
auto has_in_parameter_named (std::string_view s) const
2062
2065
-> bool
2063
2066
{
@@ -2469,6 +2472,15 @@ struct declaration_node
2469
2472
return std::get<a_function>(type)->has_move_parameter_named (s);
2470
2473
}
2471
2474
2475
+ auto nth_parameter_type_name (int n) const
2476
+ -> std::string
2477
+ {
2478
+ if (!is_function ()) {
2479
+ return " " ;
2480
+ }
2481
+ return std::get<a_function>(type)->nth_parameter_type_name (n);
2482
+ }
2483
+
2472
2484
auto is_global () const -> bool
2473
2485
{ return !parent_declaration; }
2474
2486
@@ -2864,10 +2876,11 @@ struct declaration_node
2864
2876
}
2865
2877
2866
2878
struct declared_that_funcs {
2867
- declaration_node const * out_this_in_that = {};
2868
- declaration_node const * out_this_move_that = {};
2869
- declaration_node const * inout_this_in_that = {};
2870
- declaration_node const * inout_this_move_that = {};
2879
+ declaration_node const * out_this_in_that = {};
2880
+ declaration_node const * out_this_move_that = {};
2881
+ declaration_node const * inout_this_in_that = {};
2882
+ declaration_node const * inout_this_move_that = {};
2883
+ std::vector<std::string> assignments_from = {};
2871
2884
};
2872
2885
2873
2886
auto find_declared_that_functions () const
@@ -2898,6 +2911,9 @@ struct declaration_node
2898
2911
if (decl->is_assignment_with_move_that ()) {
2899
2912
ret.inout_this_move_that = decl;
2900
2913
}
2914
+ if (decl->is_assignment () && !decl->is_assignment_with_that ()) {
2915
+ ret.assignments_from .emplace_back ( decl->nth_parameter_type_name (2 ) );
2916
+ }
2901
2917
}
2902
2918
}
2903
2919
@@ -3083,6 +3099,18 @@ auto parameter_declaration_node::has_name(std::string_view s) const
3083
3099
}
3084
3100
3085
3101
3102
+ auto function_type_node::nth_parameter_type_name (int n) const
3103
+ -> std::string
3104
+ {
3105
+ if (std::ssize (parameters->parameters ) >= n)
3106
+ {
3107
+ return parameters->parameters [n-1 ]->declaration ->get_object_type ()->to_string ();
3108
+ }
3109
+ // Else
3110
+ return " " ;
3111
+ }
3112
+
3113
+
3086
3114
auto function_type_node::is_function_with_this () const
3087
3115
-> bool
3088
3116
{
0 commit comments