(
declarations: Declarations,
options?: { compat?: boolean }
)
| 131 | * require `set` operands (every Fungrim domain is mathematically a set). |
| 132 | * Rewrite `collection` -> `set` in shell signatures. (`set` is a subtype of |
| 133 | * `collection`, so Element/indexing-set usages keep working.) |
| 134 | */ |
| 135 | function setify(signature: string): string { |
| 136 | return signature.replace(/\bcollection\b/g, 'set'); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Names from the declarations table that are NOT engine built-ins — the |
| 141 | * true shells. The table is generated when the translator runs; heads |
| 142 | * promoted to engine built-ins since then (e.g. the Tier-2 special-function |
| 143 | * kernels: EllipticK/E, AGM, Hypergeometric2F1/1F1, JacobiTheta, |
| 144 | * DedekindEta) must not be re-declared, or the signature-only shell would |
| 145 | * shadow the built-in and hide its numeric evaluator. |
| 146 | */ |
| 147 | export function shellOnlyNames(declarations: Declarations): Set<string> { |
| 148 | const probe = new ComputeEngine(); |
| 149 | const out = new Set<string>(); |
| 150 | for (const name of Object.keys(declarations.declarations)) |
| 151 | if (probe.lookupDefinition(name) === undefined) out.add(name); |
| 152 | return out; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Create a ComputeEngine with every shell declared in a dedicated child |
no test coverage detected