MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / elements

Method elements

src/extraction/tree-sitter.ts:6777–6790  ·  view source on GitHub ↗
(list: SyntaxNode, depth: number)

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected