From 423fdeebe9247b16744fae4b50df415bbd08be04 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 6 May 2019 22:09:55 +0200 Subject: Reorganize dhall into a phase structure --- dhall/src/phase/normalize.rs | 1888 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1888 insertions(+) create mode 100644 dhall/src/phase/normalize.rs (limited to 'dhall/src/phase/normalize.rs') diff --git a/dhall/src/phase/normalize.rs b/dhall/src/phase/normalize.rs new file mode 100644 index 0000000..2340bbd --- /dev/null +++ b/dhall/src/phase/normalize.rs @@ -0,0 +1,1888 @@ +#![allow(non_snake_case)] +use std::collections::BTreeMap; +use std::rc::Rc; + +use dhall_proc_macros as dhall; +use dhall_syntax::context::Context; +use dhall_syntax::{ + rc, BinOp, Builtin, Const, ExprF, Integer, InterpolatedTextContents, Label, + Natural, V, X, +}; + +use crate::phase::{NormalizedSubExpr, ResolvedSubExpr, Type, Typed}; + +type InputSubExpr = ResolvedSubExpr; +type OutputSubExpr = NormalizedSubExpr; + +/// Stores a pair of variables: a normal one and if relevant one +/// that corresponds to the alpha-normalized version of the first one. +#[derive(Debug, Clone, Eq)] +pub(crate) struct AlphaVar { + normal: V