From ab100be616932dab22a5309df86107b66e93db37 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 4 May 2019 18:41:22 +0200 Subject: Revert "Make SubExpr generic in the variable labels type" This reverts commit 4c159640e5ee77ffa48b85a5bffa56350cf933ef. --- dhall/src/expr.rs | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'dhall/src/expr.rs') diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index efc3928..5bde68f 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -23,17 +23,15 @@ macro_rules! derive_other_traits { }; } -type OutputSubExpr = SubExpr; - #[derive(Debug, Clone)] pub(crate) struct Parsed( - pub(crate) SubExpr, + pub(crate) SubExpr, pub(crate) ImportRoot, ); derive_other_traits!(Parsed); #[derive(Debug, Clone)] -pub(crate) struct Resolved(pub(crate) SubExpr); +pub(crate) struct Resolved(pub(crate) SubExpr); derive_other_traits!(Resolved); pub(crate) use self::typed::TypedInternal; @@ -59,12 +57,12 @@ impl std::fmt::Display for Normalized { } mod typed { - use super::{OutputSubExpr, Type, Typed}; + use super::{Type, Typed}; use crate::normalize::{Thunk, Value}; use crate::typecheck::{ TypeError, TypeInternal, TypeMessage, TypecheckContext, }; - use dhall_syntax::{Const, Label, Var}; + use dhall_syntax::{Const, Label, SubExpr, V, X}; use std::borrow::Cow; #[derive(Debug, Clone)] @@ -92,7 +90,7 @@ mod typed { } } - pub(crate) fn to_expr(&self) -> OutputSubExpr { + pub(crate) fn to_expr(&self) -> SubExpr { self.to_value().normalize_to_expr() } @@ -131,7 +129,7 @@ mod typed { } } - pub(crate) fn shift(&self, delta: isize, var: &Var