* @param {number} start * @param {string} code
(start, code)
| 100 | * @param {string} code |
| 101 | */ |
| 102 | function find_closing_parenthesis(start, code) { |
| 103 | let parenthesis = 1; |
| 104 | let end = start; |
| 105 | let char = code[end]; |
| 106 | // find the closing parenthesis |
| 107 | while (parenthesis !== 0 && char) { |
| 108 | if (char === '(') parenthesis++; |
| 109 | if (char === ')') parenthesis--; |
| 110 | end++; |
| 111 | char = code[end]; |
| 112 | } |
| 113 | return end; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Does a best-effort migration of Svelte code towards using runes, event attributes and render tags. |