From 5f0331e9a339768dfa40018d1f82c4815dbd11af Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 18 Mar 2019 05:50:09 +0100 Subject: Implement a few more primitives --- dhall_generator/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dhall_generator/src') 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 -- cgit v1.2.3