summaryrefslogtreecommitdiff
path: root/dhall/src/normalize.rs
diff options
context:
space:
mode:
authorNadrieril2019-05-04 16:50:38 +0200
committerNadrieril2019-05-04 16:50:38 +0200
commit0e5c93c398645d39fceb98d054f1a7e67025b4fd (patch)
treec5a093c8d9a05cb50e83966fe4923c134f5c3515 /dhall/src/normalize.rs
parent408bba76bd95a2aabd49046443950a37771f6008 (diff)
Keep Spans through normalization and typechecking
Diffstat (limited to 'dhall/src/normalize.rs')
-rw-r--r--dhall/src/normalize.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs
index 4d87225..8ae746d 100644
--- a/dhall/src/normalize.rs
+++ b/dhall/src/normalize.rs
@@ -6,12 +6,12 @@ use dhall_proc_macros as dhall;
use dhall_syntax::context::Context;
use dhall_syntax::{
rc, BinOp, Builtin, Const, ExprF, Integer, InterpolatedText,
- InterpolatedTextContents, Label, Natural, SubExpr, V, X,
+ InterpolatedTextContents, Label, Natural, Span, SubExpr, V, X,
};
use crate::expr::{Normalized, Type, Typed, TypedInternal};
-type InputSubExpr = SubExpr<X, Normalized>;
+type InputSubExpr = SubExpr<Span, Normalized>;
type OutputSubExpr = SubExpr<X, X>;
impl Typed {
@@ -110,10 +110,7 @@ impl NormalizationContext {
for v in vs.iter() {
let new_item = match v {
Type(var, _) => EnvItem::Skip(var.clone()),
- Value(e) => EnvItem::Thunk(Thunk::new(
- NormalizationContext::new(),
- e.as_expr().embed_absurd(),
- )),
+ Value(e) => EnvItem::Thunk(e.to_thunk()),
};
ctx = ctx.insert(k.clone(), new_item);
}
@@ -736,7 +733,10 @@ mod thunk {
}
pub(crate) fn from_normalized_expr(e: OutputSubExpr) -> Thunk {
- Thunk::new(NormalizationContext::new(), e.embed_absurd())
+ Thunk::new(
+ NormalizationContext::new(),
+ e.embed_absurd().note_absurd(),
+ )
}
// Normalizes contents to normal form; faster than `normalize_nf` if