(keywords: Dict, $: InternalScope)
| 391 | |
| 392 | /** what an ambient holds, each bound to `$` once it's read */ |
| 393 | const bindKeywords = (keywords: Dict, $: InternalScope): object => { |
| 394 | const bound = hasArkKind(keywords, "module") ? new RootModule({}) : {} |
| 395 | const resolve = (k: string) => { |
| 396 | const keyword = keywords[k] |
| 397 | if (hasArkKind(keyword, "module")) return bindKeywords(keyword, $) |
| 398 | const resolution = $.bindKw(keyword as BaseRoot | GenericRoot) |
| 399 | // a resolved scope has already compiled the nodes bound before it |
| 400 | return $.resolved ? finalizeExport($, resolution) : resolution |
| 401 | } |
| 402 | for (const k of Object.keys(keywords)) defineLazily(bound, k, resolve) |
| 403 | return bound |
| 404 | } |
| 405 | |
| 406 | export type UnitTypeParser<$> = <const t>(value: t) => Type<t, $> |
| 407 |
no test coverage detected