summaryrefslogtreecommitdiff
path: root/dhall_generator
diff options
context:
space:
mode:
authorNadrieril2019-03-08 22:46:39 +0100
committerNadrieril2019-03-08 22:46:39 +0100
commitd3f4a32d1e3d39c8d42306e5ca5ad4bb256edcd8 (patch)
tree113e9a9aaac158a5c0d110b3ce93c2a531957c27 /dhall_generator
parent66bed8dbc7249e17a89adcbb19406f4126a434de (diff)
Rename Expr back to its true name
Diffstat (limited to '')
-rw-r--r--dhall_generator/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index d84bea4..75912d0 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -8,7 +8,7 @@ use quote::quote;
#[proc_macro]
pub fn dhall(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input_str = input.to_string();
- let expr: Box<Expr<X, Import>> = parser::parse_expr(&input_str).unwrap();
+ let expr: Box<Expr<_, X, Import>> = parser::parse_expr(&input_str).unwrap();
let no_import =
|_: &Import| -> X { panic!("Don't use import in dhall!()") };
let expr = expr.take_ownership_of_labels().map_embed(&no_import);
@@ -19,10 +19,10 @@ pub fn dhall(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
// Returns an expression of type Expr<_, _>. Expects input variables
// to be of type Box<Expr<_, _>> (future-proof for structural sharing).
fn dhall_to_tokenstream<L: StringLike>(
- expr: &Expr_<L, X, X>,
+ expr: &Expr<L, X, X>,
ctx: &Context<L, ()>,
) -> TokenStream {
- use dhall_core::Expr_::*;
+ use dhall_core::Expr::*;
match expr {
e @ Var(_) => {
let v = dhall_to_tokenstream_bx(e, ctx);
@@ -75,10 +75,10 @@ fn dhall_to_tokenstream<L: StringLike>(
// Returns an expression of type Box<Expr<_, _>>
fn dhall_to_tokenstream_bx<L: StringLike>(
- expr: &Expr_<L, X, X>,
+ expr: &Expr<L, X, X>,
ctx: &Context<L, ()>,
) -> TokenStream {
- use dhall_core::Expr_::*;
+ use dhall_core::Expr::*;
match expr {
Var(V(s, n)) => {
match ctx.lookup(&s, *n) {
@@ -93,7 +93,7 @@ fn dhall_to_tokenstream_bx<L: StringLike>(
// TODO: insert appropriate shifts ?
let v: TokenStream = s.parse().unwrap();
quote! { {
- let x: Box<Expr_<_, _, _>> = #v.clone();
+ let x: Box<Expr<_, _, _>> = #v.clone();
x
} }
}