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

Method elements

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

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected