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

Method read

src/resolution/jsx-code.ts:157–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155 }
156
157 read(): string | null {
158 const budget = 4 * this.n + 65536;
159 let steps = 0;
160 for (;;) {
161 while (this.i < this.n) {
162 if (++steps > budget) return null;
163 const top = this.stack[this.stack.length - 1]!;
164 const c = this.src.charCodeAt(this.i);
165 const ok =
166 top.mode === 'code' ? this.code(top, c)
167 : top.mode === 'template' ? this.template(c)
168 : top.mode === 'tag' ? this.tag(top, c)
169 : this.children(top, c);
170 if (!ok) return null;
171 }
172 if (this.stack.length === 1 && this.stack[0]!.braces === 0) break;
173 if (!this.reread()) return null;
174 }
175 return blankRanges(this.src, this.blanks);
176 }
177
178 private blank(from: number, to: number): void {
179 if (to > from) this.blanks.push(from, Math.min(to, this.n));

Callers

nothing calls this directly

Calls 6

codeMethod · 0.95
templateMethod · 0.95
tagMethod · 0.95
childrenMethod · 0.95
rereadMethod · 0.95
blankRangesFunction · 0.70

Tested by

no test coverage detected