summaryrefslogtreecommitdiff
path: root/dhall_generator/src
diff options
context:
space:
mode:
authorNadrieril2019-03-06 23:35:39 +0100
committerNadrieril2019-03-06 23:35:39 +0100
commit54382cd107d1befd6015f8232716158a20db44a4 (patch)
tree81afc63e474ad58f384dde36550f9d50756c5217 /dhall_generator/src
parent39fc0af2548127a7c2ee1345d4ea63d473e0ab5a (diff)
Start parsing imports
Diffstat (limited to 'dhall_generator/src')
-rw-r--r--dhall_generator/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index 5b3cc6f..b26ea63 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -8,7 +8,9 @@ use quote::quote;
#[proc_macro]
pub fn dhall(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input_str = input.to_string();
- let expr = parser::parse_expr_pest(&input_str).unwrap();
+ let expr: Box<Expr<X, Import>> = parser::parse_expr_pest(&input_str).unwrap();
+ let no_import = |_: &Import| -> X { panic!("Don't use import in dhall!()") };
+ let expr = expr.map_embed(&no_import);
let output = dhall_to_tokenstream(&expr, &Context::new());
output.into()
}