diff options
author | Nadrieril | 2020-12-07 19:02:07 +0000 |
---|---|---|
committer | Nadrieril | 2020-12-07 19:35:30 +0000 |
commit | 4473f3549f331c51a7df0e307d356a06c00d7288 (patch) | |
tree | ba36f2ecb834d861f606d2fef09038f0de5cdc91 /dhall/src/semantics/nze | |
parent | 7a392b07166c089979e69d4c8a68da3298964c28 (diff) |
Resolve imports and alternatives outside of the ast traversal
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/nze/normalize.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dhall/src/semantics/nze/normalize.rs b/dhall/src/semantics/nze/normalize.rs index 0a09a80..59710d1 100644 --- a/dhall/src/semantics/nze/normalize.rs +++ b/dhall/src/semantics/nze/normalize.rs @@ -160,6 +160,14 @@ pub fn normalize_hir<'cx>(env: &NzEnv<'cx>, hir: &Hir<'cx>) -> NirKind<'cx> { let typed = env.cx()[import].unwrap_result(); normalize_hir(env, &typed.hir) } + HirKind::ImportAlternative(alt, left, right) => { + let hir = if env.cx()[alt].unwrap_selected() { + left + } else { + right + }; + normalize_hir(env, hir) + } HirKind::Expr(ExprKind::Lam(binder, annot, body)) => { let annot = annot.eval(env); NirKind::LamClosure { |