MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / splitLines

Method splitLines

static/panes/stack-usage-view.ts:125–130  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

123
124 showStackUsageResults(suEntries: suCodeEntry[], source: string) {
125 const splitLines = (text: string): string[] => {
126 if (!text) return [];
127 const result = text.split(/\r?\n/);
128 if (result.length > 0 && result[result.length - 1] === '') return result.slice(0, -1);
129 return result;
130 };
131
132 const srcLines: string[] = source ? splitLines(source) : [];
133 const srcAsSuLines: SuViewLine[] = srcLines.map((line, i) => ({text: line, srcLine: i, suClass: 'None'}));

Callers 15

initialiseMethod · 0.80
processIrMethod · 0.80
processOutputMethod · 0.80
demangleSingleSetMethod · 0.80
demangleFromStdinMethod · 0.80
processAsmMethod · 0.80
processMethod · 0.80
processAsmMethod · 0.80
processBinaryAsmMethod · 0.80
processAsmMethod · 0.80
processBinaryAsmMethod · 0.80
processMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected