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

Function regionEnd

src/extraction/languages/cobol.ts:382–391  ·  view source on GitHub ↗
(i: number, sectionsOnly: boolean)

Source from the content-addressed store, hash-verified

380): void {
381 /** 1-based last line of the region started at children[i]. */
382 const regionEnd = (i: number, sectionsOnly: boolean): number => {
383 for (let j = i + 1; j < children.length; j++) {
384 const c = children[j]!;
385 if (c.type === 'section_header' || (!sectionsOnly && c.type === 'paragraph_header')) {
386 // Header starts at 0-based row R → the region ends on 1-based line R.
387 return Math.max(c.startPosition.row, line(children[i]!));
388 }
389 }
390 return divisionEndLine;
391 };
392
393 let currentFnId = currentScope(ctx);
394 let sectionPushed = false;

Callers 1

walkProcedureChildrenFunction · 0.85

Calls 1

lineFunction · 0.85

Tested by

no test coverage detected