From b0eb080caab28196a09c5b60c5b6556846732563 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 6 Apr 2019 23:07:30 +0200 Subject: Store the whole type hierarchy in a Type --- dhall/src/expr.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'dhall/src/expr.rs') diff --git a/dhall/src/expr.rs b/dhall/src/expr.rs index 831fbc5..ad35645 100644 --- a/dhall/src/expr.rs +++ b/dhall/src/expr.rs @@ -10,9 +10,14 @@ pub struct Resolved(pub(crate) SubExpr); #[derive(Debug, Clone)] pub struct Typed(pub(crate) SubExpr, pub(crate) Type); -// #[derive(Debug, Clone)] -// pub struct Type(pub(crate) Box); -pub type Type = SubExpr; +#[derive(Debug, Clone)] +pub struct Type(pub(crate) TypeInternal); + +#[derive(Debug, Clone)] +pub(crate) enum TypeInternal { + Expr(Box), + Universe(usize), +} #[derive(Debug, Clone)] pub struct Normalized(pub(crate) SubExpr, pub(crate) Type); @@ -27,9 +32,3 @@ impl std::fmt::Display for Parsed { self.0.fmt(f) } } - -// impl Type { -// pub fn as_expr(&self) -> &Normalized { -// &*self.0 -// } -// } -- cgit v1.2.3