From 48d89a280838919c1fba9e0acf1e090d3286c470 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 2 Mar 2019 22:20:33 +0100 Subject: Start implementing parsing on top of pest --- dhall/src/core.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dhall/src/core.rs') diff --git a/dhall/src/core.rs b/dhall/src/core.rs index 473a6a6..ccaf0f5 100644 --- a/dhall/src/core.rs +++ b/dhall/src/core.rs @@ -179,6 +179,8 @@ pub enum Expr<'i, S, A> { Note(S, Box>), /// `Embed path ~ path` Embed(A), + + FailedParse(String, Vec>), } /// Built-in types @@ -698,6 +700,7 @@ pub fn shift<'i, S, T, A: Clone>(d: isize, v: V, e: &Expr<'i, S, A>) -> Expr<'i, // The Dhall compiler enforces that all embedded values are closed expressions // and `shift` does nothing to a closed expression Embed(ref p) => Embed(p.clone()), + FailedParse(_, _) => unreachable!(), } } @@ -795,6 +798,7 @@ pub fn subst<'i, S, T, A>(v: V<'i>, e: &Expr<'i, S, A>, b: &Expr<'i, T, A>) -> E Field(ref a, b) => Field(bx(subst(v, e, a)), b), Note(_, ref b) => subst(v, e, b), Embed(ref p) => Embed(p.clone()), + FailedParse(_, _) => unreachable!(), } } @@ -1040,6 +1044,7 @@ pub fn normalize<'i, S, T, A>(e: &Expr<'i, S, A>) -> Expr<'i, T, A> }, Note(_, ref e) => normalize(e), Embed(ref a) => Embed(a.clone()), + FailedParse(_, _) => unreachable!(), } } -- cgit v1.2.3