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