| 6775 | array = getChildByField(array, 'declarator'); |
| 6776 | } |
| 6777 | const elements = (list: SyntaxNode, depth: number): void => { |
| 6778 | const entries = list.namedChildren.filter((c) => c.type !== 'comment'); |
| 6779 | let elided = false; |
| 6780 | for (const entry of entries) { |
| 6781 | if (depth + 1 < dimensions.length) { |
| 6782 | if (entry.type === 'initializer_list') elements(entry, depth + 1); |
| 6783 | else elided = true; // Unbraced multidimensional layout needs type information. |
| 6784 | } else { |
| 6785 | arities.push(entry.type === 'initializer_list' |
| 6786 | ? entry.namedChildren.filter((c) => c.type !== 'comment').length : 1); |
| 6787 | } |
| 6788 | } |
| 6789 | if (!elided && (entries.length === 0 || dimensions[depth]! > entries.length)) arities.push(0); |
| 6790 | }; |
| 6791 | elements(value, 0); |
| 6792 | } |
| 6793 | } |