Where an expression starting at `from` ends: its first top-level `,` or `;`, or the bracket closing around it.
(code: string, from: number, close: Map<number, number>)
| 390 | |
| 391 | /** Where an expression starting at `from` ends: its first top-level `,` or `;`, or the bracket closing around it. */ |
| 392 | function expressionEnd(code: string, from: number, close: Map<number, number>): number { |
| 393 | for (let i = from; i < code.length; i++) { |
| 394 | const c = code[i]!; |
| 395 | if (c === '(' || c === '[' || c === '{') { |
| 396 | const end = close.get(i); |
| 397 | if (end === undefined) return code.length; |
| 398 | i = end; |
| 399 | continue; |
| 400 | } |
| 401 | if (c === ',' || c === ';' || c === ')' || c === ']' || c === '}') return i; |
| 402 | } |
| 403 | return code.length; |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * A Rust file read for its bindings: its blanked text, its functions with |