(source: string, index: number)
| 130 | } |
| 131 | |
| 132 | function skipWhitespaceAndComments(source: string, index: number): number { |
| 133 | let current = index; |
| 134 | while (current < source.length) { |
| 135 | const char = source[current]; |
| 136 | const next = source[current + 1]; |
| 137 | |
| 138 | if (/\s/.test(char)) { |
| 139 | current += 1; |
| 140 | continue; |
| 141 | } |
| 142 | |
| 143 | if (char === "/" && next === "/") { |
| 144 | const newline = source.indexOf("\n", current + 2); |
| 145 | current = newline === -1 ? source.length : newline + 1; |
| 146 | continue; |
| 147 | } |
| 148 | |
| 149 | if (char === "/" && next === "*") { |
| 150 | const end = source.indexOf("*/", current + 2); |
| 151 | current = end === -1 ? source.length : end + 2; |
| 152 | continue; |
| 153 | } |
| 154 | |
| 155 | return current; |
| 156 | } |
| 157 | |
| 158 | return current; |
| 159 | } |
| 160 | |
| 161 | function readStringLiteral( |
| 162 | source: string, |
no outgoing calls
no test coverage detected