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

Function templateText

src/resolution/ambient-modules.ts:433–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

431
432 // Reads a template literal's text from `i` up to its closing backtick or a `${`.
433 const templateText = (): void => {
434 while (i < n) {
435 const c = source.charCodeAt(i);
436 if (c === 92 /* \ */) {
437 if (source.charCodeAt(i + 1) === 10) newline(i + 1);
438 i += 2;
439 continue;
440 }
441 if (c === 96 /* ` */) {
442 i++;
443 return;
444 }
445 if (c === 36 /* $ */ && source.charCodeAt(i + 1) === 123 /* { */) {
446 templates.push(depth);
447 i += 2;
448 return;
449 }
450 if (c === 10) newline(i);
451 i++;
452 }
453 };
454
455 while (i < n) {
456 const c = source.charCodeAt(i);

Callers 1

tokenizeFunction · 0.85

Calls 2

newlineFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected