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

Method children

src/resolution/jsx-code.ts:490–518  ·  view source on GitHub ↗

One step among an element's children. False when the file is given up.

(top: Frame, c: number)

Source from the content-addressed store, hash-verified

488
489 /** One step among an element's children. False when the file is given up. */
490 private children(top: Frame, c: number): boolean {
491 const src = this.src;
492 const i = this.i;
493 if (c === 123) {
494 this.codeFrame();
495 this.i = i + 1;
496 return true;
497 }
498 if (c === 60) {
499 const d = src.charCodeAt(i + 1);
500 if (d === 47) {
501 const start = skipSpace(src, i + 2);
502 const end = nameEnd(src, start);
503 const gt = skipSpace(src, end);
504 if (src.charCodeAt(gt) !== 62 || src.slice(start, end) !== top.name) return this.reread();
505 this.i = gt + 1;
506 this.closeElement();
507 return true;
508 }
509 if ((d === 62 || isIdStart(d)) && this.openElement(i)) return true;
510 return this.reread();
511 }
512 // JSX text can't hold a `>` or a `}`: code read as text.
513 if (c === 62 || c === 125) return this.reread();
514 let end = i + 1;
515 for (let e = src.charCodeAt(end); end < this.n && e !== 123 && e !== 60 && e !== 62 && e !== 125; e = src.charCodeAt(++end));
516 this.i = end;
517 return true;
518 }
519}

Callers 3

readMethod · 0.95
type_alias_nameFunction · 0.80
ctor_infoMethod · 0.80

Calls 7

codeFrameMethod · 0.95
rereadMethod · 0.95
closeElementMethod · 0.95
openElementMethod · 0.95
nameEndFunction · 0.85
isIdStartFunction · 0.85
skipSpaceFunction · 0.70

Tested by

no test coverage detected