diff options
author | Nadrieril | 2020-01-18 18:46:09 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-18 18:54:42 +0000 |
commit | ec28905d32c23109da17696faefab284fde3e103 (patch) | |
tree | cd46bc2276e55c2cb89ddba6bb34a398f9ea2c56 /dhall/src/semantics/phase | |
parent | b7d847cc812e6a7ce52354b15a9ed6b41ffeb3b4 (diff) |
Introduce intermediate representation that stores typed expr
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/phase/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dhall/src/semantics/phase/mod.rs b/dhall/src/semantics/phase/mod.rs index 6afed88..4dc91e7 100644 --- a/dhall/src/semantics/phase/mod.rs +++ b/dhall/src/semantics/phase/mod.rs @@ -4,7 +4,6 @@ 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::to_expr::ToExprOptions; use crate::syntax::binary; use crate::syntax::{Builtin, Const, Expr}; use resolve::ImportRoot; @@ -38,6 +37,15 @@ pub struct Typed(Value); #[derive(Debug, Clone)] pub struct Normalized(Typed); +/// Controls conversion from `Value` to `Expr` +#[derive(Copy, Clone)] +pub(crate) struct ToExprOptions { + /// Whether to convert all variables to `_` + pub(crate) alpha: bool, + /// Whether to normalize before converting + pub(crate) normalize: bool, +} + impl Parsed { pub fn parse_file(f: &Path) -> Result<Parsed, Error> { parse::parse_file(f) |