summaryrefslogtreecommitdiff
path: root/dhall_generator
diff options
context:
space:
mode:
authorNadrieril2019-03-18 05:50:09 +0100
committerNadrieril2019-03-18 05:50:09 +0100
commit5f0331e9a339768dfa40018d1f82c4815dbd11af (patch)
tree79a890d9b41db521dd6ec92e7518daf9774606c6 /dhall_generator
parent92ea98da2f89348c3dfdc7d49594a4d876d06ba2 (diff)
Implement a few more primitives
Diffstat (limited to '')
-rw-r--r--dhall_generator/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index 528f0ea..107144c 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -60,6 +60,9 @@ fn dhall_to_tokenstream(
let b = dhall_to_tokenstream_bx(b, ctx);
quote! { BinOp(#o, #a, #b) }
}
+ NaturalLit(n) => {
+ quote! { NaturalLit(#n) }
+ }
OptionalLit(t, e) => {
let t = option_to_tokenstream(t, ctx);
let e = option_to_tokenstream(e, ctx);
@@ -77,6 +80,10 @@ fn dhall_to_tokenstream(
let m = map_to_tokenstream(m, ctx);
quote! { Record(#m) }
}
+ RecordLit(m) => {
+ let m = map_to_tokenstream(m, ctx);
+ quote! { RecordLit(#m) }
+ }
e => unimplemented!("{:?}", e),
}
}
@@ -139,6 +146,7 @@ fn map_to_tokenstream(
})
.unzip();
quote! { {
+ use std::collections::BTreeMap;
let mut m = BTreeMap::new();
#( m.insert(#keys, #values); )*
m