From d3f4a32d1e3d39c8d42306e5ca5ad4bb256edcd8 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 8 Mar 2019 22:46:39 +0100 Subject: Rename Expr back to its true name --- dhall_core/src/core.rs | 175 ++++++++++++++++++++--------------------- dhall_core/src/grammar_util.rs | 2 +- dhall_core/src/parser.rs | 76 +++++++++--------- 3 files changed, 126 insertions(+), 127 deletions(-) (limited to 'dhall_core') diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 2465629..04c3961 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -136,9 +136,8 @@ pub enum BinOp { } /// Syntax tree for expressions -pub type Expr<'i, S, A> = Expr_<&'i str, S, A>; #[derive(Debug, Clone, PartialEq)] -pub enum Expr_ { +pub enum Expr { /// `Const c ~ c` Const(Const), /// `Var (V x 0) ~ x`
@@ -147,49 +146,49 @@ pub enum Expr_ { /// `Lam x A b ~ λ(x : A) -> b` Lam( Label, - Box>, - Box>, + Box>, + Box>, ), /// `Pi "_" A B ~ A -> B` /// `Pi x A B ~ ∀(x : A) -> B` Pi( Label, - Box>, - Box>, + Box>, + Box>, ), /// `App f A ~ f A` App( - Box>, - Box>, + Box>, + Box>, ), /// `Let x Nothing r e ~ let x = r in e` /// `Let x (Just t) r e ~ let x : t = r in e` Let( Label, - Option>>, - Box>, - Box>, + Option>>, + Box>, + Box>, ), /// `Annot x t ~ x : t` Annot( - Box>, - Box>, + Box>, + Box>, ), /// Built-in values Builtin(Builtin), // Binary operations BinOp( BinOp, - Box>, - Box>, + Box>, + Box>, ), /// `BoolLit b ~ b` BoolLit(bool), /// `BoolIf x y z ~ if x then y else z` BoolIf( - Box>, - Box>, - Box>, + Box>, + Box>, + Box>, ), /// `NaturalLit n ~ +n` NaturalLit(Natural), @@ -201,37 +200,37 @@ pub enum Expr_ { TextLit(Builder), /// `ListLit t [x, y, z] ~ [x, y, z] : List t` ListLit( - Option>>, - Vec>, + Option>>, + Vec>, ), /// `OptionalLit t [e] ~ [e] : Optional t` /// `OptionalLit t [] ~ [] : Optional t` OptionalLit( - Option>>, - Vec>, + Option>>, + Vec>, ), /// `Record [(k1, t1), (k2, t2)] ~ { k1 : t1, k2 : t1 }` - Record(BTreeMap>), + Record(BTreeMap>), /// `RecordLit [(k1, v1), (k2, v2)] ~ { k1 = v1, k2 = v2 }` - RecordLit(BTreeMap>), + RecordLit(BTreeMap>), /// `Union [(k1, t1), (k2, t2)] ~ < k1 : t1, k2 : t2 >` - Union(BTreeMap>), + Union(BTreeMap>), /// `UnionLit (k1, v1) [(k2, t2), (k3, t3)] ~ < k1 = t1, k2 : t2, k3 : t3 >` UnionLit( Label, - Box>, - BTreeMap>, + Box>, + BTreeMap>, ), /// `Merge x y t ~ merge x y : t` Merge( - Box>, - Box>, - Option>>, + Box>, + Box>, + Option>>, ), /// `Field e x ~ e.x` - Field(Box>, Label), + Field(Box>, Label), /// Annotation on the AST. Unused for now but could hold e.g. file location information - Note(Note, Box>), + Note(Note, Box>), /// Embeds an import or the result of resolving the import Embed(Embed), } @@ -291,32 +290,32 @@ impl