| 6974 | array = getChildByField(array, 'declarator'); |
| 6975 | } |
| 6976 | const elements = (list: SyntaxNode, depth: number): void => { |
| 6977 | const entries = list.namedChildren.filter((c) => c.type !== 'comment'); |
| 6978 | let elided = false; |
| 6979 | for (const entry of entries) { |
| 6980 | if (depth + 1 < dimensions.length) { |
| 6981 | if (entry.type === 'initializer_list') elements(entry, depth + 1); |
| 6982 | else elided = true; // Unbraced multidimensional layout needs type information. |
| 6983 | } else { |
| 6984 | arities.push(entry.type === 'initializer_list' |
| 6985 | ? entry.namedChildren.filter((c) => c.type !== 'comment').length : 1); |
| 6986 | } |
| 6987 | } |
| 6988 | if (!elided && (entries.length === 0 || dimensions[depth]! > entries.length)) arities.push(0); |
| 6989 | }; |
| 6990 | elements(value, 0); |
| 6991 | } |
| 6992 | } |