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

Function vbCode

src/resolution/vbnet-receivers.ts:177–198  ·  view source on GitHub ↗

A VB.NET line's code: its comment dropped and every string literal emptied to `""`.

(line: string)

Source from the content-addressed store, hash-verified

175
176/** A VB.NET line's code: its comment dropped and every string literal emptied to `""`. */
177function 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
200const VB_CODE_LINES = new WeakMap<ResolutionContext, Map<string, string[]>>();
201

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected