diff options
author | Nadrieril | 2019-03-02 22:20:33 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-02 22:20:33 +0100 |
commit | 48d89a280838919c1fba9e0acf1e090d3286c470 (patch) | |
tree | e6351642703a95aad8cdb486dade1b314b708c5b /dhall/src/core.rs | |
parent | 17fd0dd6d7ab9ef9529be0b0d70fcea683c08603 (diff) |
Start implementing parsing on top of pest
Diffstat (limited to 'dhall/src/core.rs')
-rw-r--r-- | dhall/src/core.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<Expr<'i, S, A>>), /// `Embed path ~ path` Embed(A), + + FailedParse(String, Vec<Expr<'i, S, A>>), } /// 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!(), } } |