()
| 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; |