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

Function statementEnd

src/resolution/angular-template-synthesizer.ts:442–458  ·  view source on GitHub ↗

The `;` that ends a `@let` declaration's expression, or -1.

(text: string, from: number)

Source from the content-addressed store, hash-verified

440
441/** The `;` that ends a `@let` declaration's expression, or -1. */
442function statementEnd(text: string, from: number): number {
443 let depth = 0;
444 for (let i = from; i < text.length; i++) {
445 const ch = text[i]!;
446 if (ch === '"' || ch === "'" || ch === '`') {
447 const end = skipString(text, i);
448 if (end < 0) return -1;
449 i = end;
450 continue;
451 }
452 if (ch === '(' || ch === '[' || ch === '{') depth++;
453 else if (ch === ')' || ch === ']' || ch === '}') {
454 if (--depth < 0) return -1;
455 } else if (ch === ';' && depth === 0) return i;
456 }
457 return -1;
458}
459
460/**
461 * Every name a template's bindings call or read at render — property

Callers 1

templateMemberUsesFunction · 0.70

Calls 1

skipStringFunction · 0.90

Tested by

no test coverage detected