The statement starting at `start`, joined over the lines its brackets keep open.
(lines: readonly string[], start: number)
| 48 | |
| 49 | /** The statement starting at `start`, joined over the lines its brackets keep open. */ |
| 50 | function statement(lines: readonly string[], start: number): { text: string; end: number } { |
| 51 | let text = lines[start].trim(), end = start; |
| 52 | while (openBrackets(text) > 0 && end + 1 < lines.length && end - start < 8) text += ` ${lines[++end].trim()}`; |
| 53 | return { text: text.replace(/([([{])\s+/g, '$1').replace(/\s+([)\]}])/g, '$1').replace(/,([)\]}])/g, '$1'), end }; |
| 54 | } |
| 55 | |
| 56 | /** The first line of a docstring right after line `after`, as it is written (one or two lines). */ |
| 57 | function docstring(lines: readonly string[], after: number, indent: string): string[] { |
no test coverage detected