diff options
Diffstat (limited to 'dhall_core')
-rw-r--r-- | dhall_core/src/core.rs | 4 | ||||
-rw-r--r-- | dhall_core/src/parser.rs | 2 | ||||
-rw-r--r-- | dhall_core/src/printer.rs | 11 | ||||
-rw-r--r-- | dhall_core/src/visitor.rs | 3 |
4 files changed, 6 insertions, 14 deletions
diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 9a8acc2..fa6fca4 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -180,10 +180,8 @@ pub enum ExprF<SubExpr, Label, Note, Embed> { /// `[] : Optional a` /// `[x] : Optional a` OldOptionalLit(Option<SubExpr>, SubExpr), - /// `None t` - EmptyOptionalLit(SubExpr), /// `Some e` - NEOptionalLit(SubExpr), + SomeLit(SubExpr), /// `{ k1 : t1, k2 : t1 }` RecordType(BTreeMap<Label, SubExpr>), /// `{ k1 = v1, k2 = v2 }` diff --git a/dhall_core/src/parser.rs b/dhall_core/src/parser.rs index 31249a9..ba15bae 100644 --- a/dhall_core/src/parser.rs +++ b/dhall_core/src/parser.rs @@ -754,7 +754,7 @@ make_parser! { children!( [expression(e)] => e, [Some_(()), expression(e)] => { - spanned(span, NEOptionalLit(rc(e))) + spanned(span, SomeLit(rc(e))) }, [merge(()), expression(x), expression(y)] => { spanned(span, Merge(rc(x), rc(y), None)) diff --git a/dhall_core/src/printer.rs b/dhall_core/src/printer.rs index ea291a9..c4bad71 100644 --- a/dhall_core/src/printer.rs +++ b/dhall_core/src/printer.rs @@ -38,10 +38,7 @@ impl<SE: Display + Clone, N, E: Display> Display for ExprF<SE, Label, N, E> { OldOptionalLit(Some(x), t) => { write!(f, "[{}] : Optional {}", x, t)?; } - EmptyOptionalLit(t) => { - write!(f, "None {}", t)?; - } - NEOptionalLit(e) => { + SomeLit(e) => { write!(f, "Some {}", e)?; } Merge(a, b, c) => { @@ -159,8 +156,7 @@ impl<S: Clone, A: Display + Clone> Expr<S, A> { | EmptyListLit(_) | NEListLit(_) | OldOptionalLit(_, _) - | EmptyOptionalLit(_) - | NEOptionalLit(_) + | SomeLit(_) | Merge(_, _, _) | Annot(_, _) if phase > Base => @@ -200,8 +196,7 @@ impl<S: Clone, A: Display + Clone> Expr<S, A> { ), EmptyListLit(t) => EmptyListLit(t.phase(Import)), OldOptionalLit(x, t) => OldOptionalLit(x, t.phase(Import)), - EmptyOptionalLit(t) => EmptyOptionalLit(t.phase(Import)), - NEOptionalLit(e) => NEOptionalLit(e.phase(Import)), + SomeLit(e) => SomeLit(e.phase(Import)), ExprF::App(f, a) => ExprF::App(f.phase(Import), a.phase(Import)), Field(a, b) => Field(a.phase(Primitive), b), Projection(e, ls) => Projection(e.phase(Primitive), ls), diff --git a/dhall_core/src/visitor.rs b/dhall_core/src/visitor.rs index c15aacd..caaefce 100644 --- a/dhall_core/src/visitor.rs +++ b/dhall_core/src/visitor.rs @@ -153,8 +153,7 @@ where opt(x, |e| v.visit_subexpr(e))?, v.visit_subexpr(t)?, ), - EmptyOptionalLit(t) => EmptyOptionalLit(v.visit_subexpr(t)?), - NEOptionalLit(e) => NEOptionalLit(v.visit_subexpr(e)?), + SomeLit(e) => SomeLit(v.visit_subexpr(e)?), RecordType(kts) => RecordType(btmap(kts, v)?), RecordLit(kvs) => RecordLit(btmap(kvs, v)?), UnionType(kts) => UnionType(btoptmap(kts, v)?), |