| 1926 | } |
| 1927 | |
| 1928 | fn cpp_array_arities(list: Node<'t>, dimensions: &[Option<usize>], arities: &mut Vec<usize>) { |
| 1929 | let entries: Vec<_> = (0..list.named_child_count()).filter_map(|j| list.named_child(j)) |
| 1930 | .filter(|n| n.kind() != "comment").collect(); |
| 1931 | let mut elided = false; |
| 1932 | for entry in &entries { |
| 1933 | if dimensions.len() > 1 { |
| 1934 | if entry.kind() == "initializer_list" { Self::cpp_array_arities(*entry, &dimensions[1..], arities); } |
| 1935 | else { elided = true; } |
| 1936 | } else { |
| 1937 | arities.push(if entry.kind() == "initializer_list" { |
| 1938 | (0..entry.named_child_count()).filter_map(|j| entry.named_child(j)) |
| 1939 | .filter(|n| n.kind() != "comment").count() |
| 1940 | } else { 1 }); |
| 1941 | } |
| 1942 | } |
| 1943 | if !elided && (entries.is_empty() || dimensions[0].map(|n| n > entries.len()).unwrap_or(false)) { |
| 1944 | arities.push(0); |
| 1945 | } |
| 1946 | } |
| 1947 | |
| 1948 | fn cpp_object_array(&self, node: Node<'t>) -> bool { |
| 1949 | let mut element = node.child_by_field_name("declarator"); |