File tree Expand file tree Collapse file tree
tests/snapshots/should_handle_array_param Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,6 +230,30 @@ def get_doxygen_params(
230230 resolve_ref_text_name (param .defval ).strip () if param .defval else None
231231 )
232232
233+ # Doxygen splits array dimensions into a separate <array> element.
234+ # For complex declarators like "PropNameID (&&propertyNames)[N]",
235+ # doxygen gives type="PropNameID(&&)", name="propertyNames",
236+ # array="[N]". We must reconstruct the full declarator with the
237+ # name embedded inside the grouping parentheses:
238+ # PropNameID(&&propertyNames)[N]
239+ param_array = param .array
240+ if param_array :
241+ # Match type ending with a pointer/reference declarator group:
242+ # e.g. "PropNameID(&&)", "int(&)", "void(*)"
243+ m = re .search (r"\([*&]+\)\s*$" , param_type )
244+ if m and param_name :
245+ # Insert name before the closing ')' and append array
246+ insert_pos = m .end () - 1 # position of trailing ')'
247+ param_type = (
248+ param_type [:insert_pos ]
249+ + param_name
250+ + param_type [insert_pos :]
251+ + param_array
252+ )
253+ param_name = None
254+ else :
255+ param_type += param_array
256+
233257 qualifiers , core_type = extract_qualifiers (param_type )
234258 arguments .append ((qualifiers , core_type , param_name , param_default ))
235259
Original file line number Diff line number Diff line change 1+ struct test::Node {
2+ public void setArray(int(&arr)[10]);
3+ template <size_t N>
4+ public static std::vector< test::PropNameID > names(PropNameID(&&propertyNames)[N]);
5+ }
6+
7+ struct test::PropNameID {
8+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ */
7+
8+ #pragma once
9+
10+ namespace test {
11+
12+ struct PropNameID {};
13+
14+ struct Node {
15+ template <size_t N>
16+ static std::vector<PropNameID> names (PropNameID (&&propertyNames)[N]);
17+
18+ void setArray (int (&arr)[10]);
19+ };
20+
21+ } // namespace test
You can’t perform that action at this time.
0 commit comments