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

Method code

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

One step among code. False when the file is given up.

(top: Frame, c: number)

Source from the content-addressed store, hash-verified

245
246 /** One step among code. False when the file is given up. */
247 private code(top: Frame, c: number): boolean {
248 const src = this.src;
249 const i = this.i;
250 if (isSpace(c)) {
251 this.i = i + 1;
252 return true;
253 }
254 if (c === 47) {
255 const d = src.charCodeAt(i + 1);
256 if (d === 47) {
257 const end = lineEnd(src, i);
258 this.blank(i, end);
259 this.i = end;
260 return true;
261 }
262 if (d === 42) {
263 const end = src.indexOf('*/', i + 2);
264 if (end === -1) return this.reread();
265 this.blank(i, end + 2);
266 this.i = end + 2;
267 return true;
268 }
269 if (this.exprEnd) {
270 // `/>` among code: an element read as code.
271 if (d === 62) return this.reread();
272 this.i = i + 1;
273 this.exprEnd = false;
274 this.afterDot = false;
275 return true;
276 }
277 const end = regexEnd(src, i);
278 if (end === -1) {
279 this.i = i + 1;
280 return true;
281 }
282 this.blank(i + 1, end);
283 let k = end + 1;
284 while (k < this.n && isIdPart(src.charCodeAt(k))) k++;
285 this.i = k;
286 this.exprEnd = true;
287 this.afterDot = false;
288 return true;
289 }
290 if (c === 34 || c === 39) {
291 const end = stringEnd(src, i);
292 if (end === -1) return this.reread();
293 this.blank(i + 1, end);
294 this.i = end + 1;
295 this.exprEnd = true;
296 this.afterDot = false;
297 return true;
298 }
299 if (c === 96) {
300 this.stack.push({ mode: 'template', braces: 0, name: '' });
301 this.i = i + 1;
302 return true;
303 }
304 if (c === 60) {

Callers 1

readMethod · 0.95

Calls 11

blankMethod · 0.95
rereadMethod · 0.95
openElementMethod · 0.95
regexEndFunction · 0.85
isIdPartFunction · 0.85
isIdStartFunction · 0.85
pushMethod · 0.80
hasMethod · 0.80
isSpaceFunction · 0.70
lineEndFunction · 0.70
stringEndFunction · 0.70

Tested by

no test coverage detected