diff options
author | Nadrieril | 2019-05-07 16:01:24 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-07 16:01:24 +0200 |
commit | 726c281cdd3824fcfdde34fe8d01f95416f7808c (patch) | |
tree | a3a7b89348a1f63208b3912d45e0ecd6d3f344a3 /dhall_proc_macros | |
parent | 1b8a67353a0167bdafd0b8cc03f5d83464f7af3d (diff) |
Clean up some of the SubExpr type-changing methods
Diffstat (limited to 'dhall_proc_macros')
-rw-r--r-- | dhall_proc_macros/src/quote.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dhall_proc_macros/src/quote.rs b/dhall_proc_macros/src/quote.rs index eaf4946..77ed5de 100644 --- a/dhall_proc_macros/src/quote.rs +++ b/dhall_proc_macros/src/quote.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; pub fn expr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input_str = input.to_string(); - let expr: SubExpr<_, Import> = parse_expr(&input_str).unwrap().unnote(); + let expr: SubExpr<_, Import> = parse_expr(&input_str).unwrap(); let no_import = |_: &Import| -> X { panic!("Don't use import in dhall::expr!()") }; let expr = expr.map_embed(no_import); @@ -17,7 +17,7 @@ pub fn expr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { pub fn subexpr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input_str = input.to_string(); - let expr: SubExpr<_, Import> = parse_expr(&input_str).unwrap().unnote(); + let expr: SubExpr<_, Import> = parse_expr(&input_str).unwrap(); let no_import = |_: &Import| -> X { panic!("Don't use import in dhall::subexpr!()") }; let expr = expr.map_embed(no_import); @@ -94,8 +94,8 @@ where // Returns an expression of type SubExpr<_, _>. Expects interpolated variables // to be of type SubExpr<_, _>. -fn quote_subexpr( - expr: &SubExpr<X, X>, +fn quote_subexpr<N>( + expr: &SubExpr<N, X>, ctx: &Context<Label, ()>, ) -> TokenStream { use dhall_syntax::ExprF::*; @@ -131,7 +131,7 @@ fn quote_subexpr( // Returns an expression of type Expr<_, _>. Expects interpolated variables // to be of type SubExpr<_, _>. -fn quote_expr(expr: &Expr<X, X>, ctx: &Context<Label, ()>) -> TokenStream { +fn quote_expr<N>(expr: &Expr<N, X>, ctx: &Context<Label, ()>) -> TokenStream { use dhall_syntax::ExprF::*; match expr.map_ref_with_special_handling_of_binders( |e| quote_subexpr(e, ctx), |