| 53 | |
| 54 | /** The words on a run that is not plain sequence — said on the line into it. */ |
| 55 | export function runWords(item: Extract<WireItem, { kind: 'block' }>): string { |
| 56 | switch (item.block) { |
| 57 | case 'inline': |
| 58 | return item.via ? `via ${item.via.name}` : 'via a helper'; |
| 59 | case 'loop': |
| 60 | if (!item.by) return item.loop === 'while' ? 'again and again' : 'for each item'; |
| 61 | return item.loop === 'while' ? `again while ${item.by}` : `for each ${item.by}`; |
| 62 | case 'later': |
| 63 | return item.by ? `later · ${item.by}` : 'later'; |
| 64 | default: |
| 65 | return item.by ? `together · ${item.by}` : 'together'; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /* ----------------------------------------------------------------- graph -- */ |
| 70 | |