MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / skipComment

Method skipComment

scripts/rubi/wl-parser.ts:56–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55 // WL comments nest: (* a (* b *) c *)
56 private skipComment(): void {
57 let depth = 0;
58 const s = this.src;
59 do {
60 if (s.startsWith('(*', this.pos)) {
61 depth++;
62 this.pos += 2;
63 } else if (s.startsWith('*)', this.pos)) {
64 depth--;
65 this.pos += 2;
66 } else if (this.pos >= s.length) {
67 throw new Error('unterminated comment');
68 } else this.pos++;
69 } while (depth > 0);
70 }
71
72 private tokenize(): void {
73 const s = this.src;

Callers 1

tokenizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected