The `;` that ends a `@let` declaration's expression, or -1.
(text: string, from: number)
| 440 | |
| 441 | /** The `;` that ends a `@let` declaration's expression, or -1. */ |
| 442 | function statementEnd(text: string, from: number): number { |
| 443 | let depth = 0; |
| 444 | for (let i = from; i < text.length; i++) { |
| 445 | const ch = text[i]!; |
| 446 | if (ch === '"' || ch === "'" || ch === '`') { |
| 447 | const end = skipString(text, i); |
| 448 | if (end < 0) return -1; |
| 449 | i = end; |
| 450 | continue; |
| 451 | } |
| 452 | if (ch === '(' || ch === '[' || ch === '{') depth++; |
| 453 | else if (ch === ')' || ch === ']' || ch === '}') { |
| 454 | if (--depth < 0) return -1; |
| 455 | } else if (ch === ';' && depth === 0) return i; |
| 456 | } |
| 457 | return -1; |
| 458 | } |
| 459 | |
| 460 | /** |
| 461 | * Every name a template's bindings call or read at render — property |
no test coverage detected