(text)
| 551 | } |
| 552 | |
| 553 | function extractPythonHeredocs(text) { |
| 554 | const blocks = []; |
| 555 | const regex = /(?:^|\n)[^\n]*\bpython(?:3(?:\.\d+)?)?\s+-\s*<<['"]?([A-Za-z_][A-Za-z0-9_]*)['"]?\n([\s\S]*?)\n\1(?=\n|$)/g; |
| 556 | let match = regex.exec(String(text || '')); |
| 557 | while (match) { |
| 558 | const body = String(match[2] || '').trim(); |
| 559 | if (body && looksLikePython(body)) { |
| 560 | blocks.push({ title: 'python heredoc', text: body, sourceLabel: 'python heredoc' }); |
| 561 | } |
| 562 | match = regex.exec(String(text || '')); |
| 563 | } |
| 564 | return blocks; |
| 565 | } |
| 566 | |
| 567 | function extractPythonFromPatch(text) { |
| 568 | const lines = String(text || '').split(/\r?\n/); |
no test coverage detected