A VB.NET line's code: its comment dropped and every string literal emptied to `""`.
(line: string)
| 175 | |
| 176 | /** A VB.NET line's code: its comment dropped and every string literal emptied to `""`. */ |
| 177 | function vbCode(line: string): string { |
| 178 | // Most lines have neither: the line itself, without a copy. |
| 179 | if (!/["'‘’\r]/.test(line)) return line; |
| 180 | let out = ''; |
| 181 | for (let i = 0; i < line.length; i++) { |
| 182 | const ch = line[i]!; |
| 183 | if (ch === '"') { |
| 184 | let j = i + 1; |
| 185 | for (; j < line.length; j++) { |
| 186 | if (line[j] !== '"') continue; |
| 187 | if (line[j + 1] === '"') j++; |
| 188 | else break; |
| 189 | } |
| 190 | out += '""'; |
| 191 | i = j; |
| 192 | continue; |
| 193 | } |
| 194 | if (ch === "'" || ch === '\u2018' || ch === '\u2019' || ch === '\r') break; |
| 195 | out += ch; |
| 196 | } |
| 197 | return out; |
| 198 | } |
| 199 | |
| 200 | const VB_CODE_LINES = new WeakMap<ResolutionContext, Map<string, string[]>>(); |
| 201 |
nothing calls this directly
no outgoing calls
no test coverage detected