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

Function expressionEnd

src/resolution/rust-scopes.ts:392–404  ·  view source on GitHub ↗

Where an expression starting at `from` ends: its first top-level `,` or `;`, or the bracket closing around it.

(code: string, from: number, close: Map<number, number>)

Source from the content-addressed store, hash-verified

390
391/** Where an expression starting at `from` ends: its first top-level `,` or `;`, or the bracket closing around it. */
392function expressionEnd(code: string, from: number, close: Map<number, number>): number {
393 for (let i = from; i < code.length; i++) {
394 const c = code[i]!;
395 if (c === '(' || c === '[' || c === '{') {
396 const end = close.get(i);
397 if (end === undefined) return code.length;
398 i = end;
399 continue;
400 }
401 if (c === ',' || c === ';' || c === ')' || c === ']' || c === '}') return i;
402 }
403 return code.length;
404}
405
406/**
407 * A Rust file read for its bindings: its blanked text, its functions with

Callers 1

readRustBindingsFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected