From 7743647137d1914c280e03d6aaee81e507cff97d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 30 Jan 2020 11:17:49 +0000 Subject: Remove old typecheck module --- dhall/src/semantics/phase/mod.rs | 17 +++-------------- dhall/src/semantics/phase/resolve.rs | 8 ++------ dhall/src/semantics/phase/typecheck.rs | 1 - 3 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 dhall/src/semantics/phase/typecheck.rs (limited to 'dhall/src/semantics') diff --git a/dhall/src/semantics/phase/mod.rs b/dhall/src/semantics/phase/mod.rs index 2727a61..f24a668 100644 --- a/dhall/src/semantics/phase/mod.rs +++ b/dhall/src/semantics/phase/mod.rs @@ -2,9 +2,7 @@ use std::fmt::Display; use std::path::Path; use crate::error::{EncodeError, Error, ImportError, TypeError}; -use crate::semantics::core::value::Value; -use crate::semantics::core::value::ValueKind; -use crate::semantics::tck::tyexpr::TyExpr; +use crate::semantics::{typecheck, typecheck_with, TyExpr, Value, ValueKind}; use crate::syntax::binary; use crate::syntax::{Builtin, Const, Expr}; use resolve::ImportRoot; @@ -12,7 +10,6 @@ use resolve::ImportRoot; pub(crate) mod normalize; pub(crate) mod parse; pub(crate) mod resolve; -pub(crate) mod typecheck; pub type ParsedExpr = Expr; pub type DecodedExpr = Expr; @@ -80,23 +77,15 @@ impl Parsed { impl Resolved { pub fn typecheck(&self) -> Result { - Ok(Typed(crate::semantics::tck::typecheck::typecheck(&self.0)?)) + Ok(Typed(typecheck(&self.0)?)) } pub fn typecheck_with(self, ty: &Normalized) -> Result { - Ok(Typed(crate::semantics::tck::typecheck::typecheck_with( - &self.0, - ty.to_expr(), - )?)) + Ok(Typed(typecheck_with(&self.0, ty.to_expr())?)) } /// Converts a value back to the corresponding AST expression. pub fn to_expr(&self) -> ResolvedExpr { self.0.clone() } - pub fn tck_and_normalize_new_flow(&self) -> Result { - let val = crate::semantics::tck::typecheck::typecheck(&self.0)? - .normalize_whnf_noenv(); - Ok(Normalized(val)) - } } impl Typed { diff --git a/dhall/src/semantics/phase/resolve.rs b/dhall/src/semantics/phase/resolve.rs index 64106aa..cc4a024 100644 --- a/dhall/src/semantics/phase/resolve.rs +++ b/dhall/src/semantics/phase/resolve.rs @@ -52,14 +52,10 @@ fn load_import( import_cache: &mut ImportCache, import_stack: &ImportStack, ) -> Result { - // Ok( - // do_resolve_expr(Parsed::parse_file(f)?, import_cache, import_stack)? - // .typecheck()? - // .normalize(), - // ) Ok( do_resolve_expr(Parsed::parse_file(f)?, import_cache, import_stack)? - .tck_and_normalize_new_flow()?, + .typecheck()? + .normalize(), ) } diff --git a/dhall/src/semantics/phase/typecheck.rs b/dhall/src/semantics/phase/typecheck.rs deleted file mode 100644 index 8b13789..0000000 --- a/dhall/src/semantics/phase/typecheck.rs +++ /dev/null @@ -1 +0,0 @@ - -- cgit v1.2.3