(blockSource)
| 439 | } |
| 440 | |
| 441 | function parseArraySymbols(blockSource) { |
| 442 | const entries = [] |
| 443 | for (const item of splitTopLevelCommaList(blockSource)) { |
| 444 | const line = item.trim() |
| 445 | if (!line || line.startsWith('//')) continue |
| 446 | |
| 447 | let match = line.match(/^\.\.\.\(([\s\S]+?)\?\s*\[([\s\S]+?)\]\s*:\s*\[\]\)$/) |
| 448 | if (match) { |
| 449 | const gate = match[1].trim() |
| 450 | const spreadItems = splitTopLevelCommaList(match[2]) |
| 451 | for (const spreadItem of spreadItems) { |
| 452 | entries.push({ |
| 453 | symbol: spreadItem.replace(/\(\)$/, '').trim(), |
| 454 | entryExpr: spreadItem.trim(), |
| 455 | gate, |
| 456 | }) |
| 457 | } |
| 458 | continue |
| 459 | } |
| 460 | |
| 461 | match = line.match(/^([A-Za-z_$][\w$]*(?:\(\))?)$/) |
| 462 | if (match) { |
| 463 | const entryExpr = match[1] |
| 464 | entries.push({ symbol: entryExpr.replace(/\(\)$/, ''), entryExpr, gate: '' }) |
| 465 | } |
| 466 | } |
| 467 | return entries |
| 468 | } |
| 469 | |
| 470 | function findCallObjectSource(source, calleeName) { |
| 471 | const regex = new RegExp(`\\b${calleeName}\\s*\\(`, 'm') |
no test coverage detected