From 7848c8e8d3147ebe428290558aa6c0efcbf59ee5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 18 Mar 2020 18:58:51 +0000 Subject: Brutally make all of dhall pub --- dhall/src/lib.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'dhall/src/lib.rs') diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index caaf260..34a9bac 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -26,17 +26,17 @@ use crate::syntax::Expr; pub use crate::simple::{STyKind, SValKind, SimpleType, SimpleValue}; #[derive(Debug, Clone)] -pub(crate) struct Parsed(Expr, ImportLocation); +pub struct Parsed(Expr, ImportLocation); /// An expression where all imports have been resolved /// /// Invariant: there must be no `Import` nodes or `ImportAlt` operations left. #[derive(Debug, Clone)] -pub(crate) struct Resolved(Hir); +pub struct Resolved(Hir); /// A typed expression #[derive(Debug, Clone)] -pub(crate) struct Typed { +pub struct Typed { hir: Hir, ty: Type, } @@ -45,23 +45,23 @@ pub(crate) struct Typed { /// /// This is actually a lie, because the expression will only get normalized on demand. #[derive(Debug, Clone)] -pub(crate) struct Normalized(Nir); +pub struct Normalized(Nir); /// A Dhall value. #[derive(Debug, Clone)] pub struct Value { /// Invariant: in normal form - pub(crate) hir: Hir, + pub hir: Hir, /// Cached conversions because they are annoying to construct from Hir. - pub(crate) as_simple_val: Option, - pub(crate) as_simple_ty: Option, + pub as_simple_val: Option, + pub as_simple_ty: Option, } /// Controls conversion from `Nir` to `Expr` #[derive(Copy, Clone, Default)] -pub(crate) struct ToExprOptions { +pub struct ToExprOptions { /// Whether to convert all variables to `_` - pub(crate) alpha: bool, + pub alpha: bool, } impl Parsed { @@ -96,7 +96,7 @@ impl Resolved { pub fn typecheck(&self) -> Result { Ok(Typed::from_tir(typecheck(&self.0)?)) } - pub(crate) fn typecheck_with(self, ty: &Hir) -> Result { + pub fn typecheck_with(self, ty: &Hir) -> Result { Ok(Typed::from_tir(typecheck_with(&self.0, ty)?)) } /// Converts a value back to the corresponding AST expression. @@ -122,10 +122,10 @@ impl Typed { self.hir.to_expr(ToExprOptions { alpha: false }) } - pub(crate) fn ty(&self) -> &Type { + pub fn ty(&self) -> &Type { &self.ty } - pub(crate) fn get_type(&self) -> Result { + pub fn get_type(&self) -> Result { Ok(Normalized(self.ty.clone().into_nir())) } } @@ -144,11 +144,11 @@ impl Normalized { self.0.to_expr(ToExprOptions::default()) } /// Converts a value back to the corresponding Hir expression. - pub(crate) fn to_hir(&self) -> Hir { + pub fn to_hir(&self) -> Hir { self.0.to_hir_noenv() } /// Converts a value back to the corresponding AST expression, alpha-normalizing in the process. - pub(crate) fn to_expr_alpha(&self) -> Expr { + pub fn to_expr_alpha(&self) -> Expr { self.0.to_expr(ToExprOptions { alpha: true }) } } @@ -178,7 +178,7 @@ impl Value { } /// Converts a value back to the corresponding AST expression. - pub(crate) fn to_expr(&self) -> Expr { + pub fn to_expr(&self) -> Expr { self.hir.to_expr(ToExprOptions::default()) } } -- cgit v1.2.3