45 lines of new helpers inserted at the top — shifts every symbol down.
()
| 53 | |
| 54 | /** 45 lines of new helpers inserted at the top — shifts every symbol down. */ |
| 55 | function insertedPrelude(): string { |
| 56 | const parts: string[] = []; |
| 57 | for (let h = 0; h < 4; h++) { |
| 58 | parts.push(`/** inserted helper ${h} */`); |
| 59 | parts.push(`export function insertedHelper${h}(x: number): number {`); |
| 60 | for (let s = 0; s < 7; s++) { |
| 61 | parts.push(` x = x + ${s};`); |
| 62 | } |
| 63 | parts.push(` return x;`); |
| 64 | parts.push(`}`); |
| 65 | } |
| 66 | parts.push(''); |
| 67 | return parts.join('\n') + '\n'; |
| 68 | } |
| 69 | |
| 70 | function getText(result: { content: Array<{ type: string; text?: string }>; isError?: boolean }): string { |
| 71 | return result.content.map((c) => c.text ?? '').join('\n'); |