| 471 | } |
| 472 | |
| 473 | function mapCall(wlHead: string, args: Json[]): Json { |
| 474 | // WL Log[x] is the natural log; Log[b, x] is log base b. |
| 475 | if (wlHead === 'Log') |
| 476 | return args.length === 1 ? ['Ln', args[0]] : ['Log', args[1], args[0]]; |
| 477 | const head = HEAD_MAP[wlHead]; |
| 478 | if (head) return [head, ...args]; |
| 479 | // Pass through (Hypergeometric2F1, AppellF1, EllipticE/F/Pi, PolyLog, |
| 480 | // FresnelS, … — resolved as shells or reported as unknown-symbol). |
| 481 | return [wlHead, ...args]; |
| 482 | } |
| 483 | |
| 484 | /** Parse a single WL InputForm expression. Throws on syntax errors. */ |
| 485 | export function parseWL(src: string): Json { |