summaryrefslogtreecommitdiff
path: root/dhall_syntax
diff options
context:
space:
mode:
authorNadrieril2019-08-06 22:36:43 +0200
committerNadrieril2019-08-06 22:36:43 +0200
commit705433487da3cd3b4517fcf74b0497c76dbb4080 (patch)
tree32a55f2824cd24d90211873c5bda42a14ae4824f /dhall_syntax
parent0a1cf5554e8c06d05d24bdcdcf1eb71f0ac6d8f2 (diff)
Prepare for https://github.com/dhall-lang/dhall-lang/pull/630
Diffstat (limited to 'dhall_syntax')
-rw-r--r--dhall_syntax/src/parser.rs3
-rw-r--r--dhall_syntax/src/printer.rs3
2 files changed, 3 insertions, 3 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs
index 8355ebf..0832af3 100644
--- a/dhall_syntax/src/parser.rs
+++ b/dhall_syntax/src/parser.rs
@@ -752,7 +752,8 @@ make_parser! {
spanned(span, Merge(x, y, Some(z)))
},
[List(()), expression(x)] => {
- spanned(span, EmptyListLit(x))
+ let list = unspanned(Builtin(crate::Builtin::List));
+ spanned(span, EmptyListLit(unspanned(App(list, x))))
},
[expression(e)] => e,
));
diff --git a/dhall_syntax/src/printer.rs b/dhall_syntax/src/printer.rs
index 2b2bbcc..52d3d81 100644
--- a/dhall_syntax/src/printer.rs
+++ b/dhall_syntax/src/printer.rs
@@ -27,7 +27,7 @@ impl<SE: Display + Clone, E: Display> Display for ExprF<SE, E> {
write!(f, " = {} in {}", c, d)?;
}
EmptyListLit(t) => {
- write!(f, "[] : List {}", t)?;
+ write!(f, "[] : {}", t)?;
}
NEListLit(es) => {
fmt_list("[", ", ", "]", es, f, Display::fmt)?;
@@ -182,7 +182,6 @@ impl<S: Clone, A: Display + Clone> Expr<S, A> {
a.phase(PrintPhase::BinOp(op)),
b.phase(PrintPhase::BinOp(op)),
),
- EmptyListLit(t) => EmptyListLit(t.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),