summaryrefslogtreecommitdiff
path: root/dhall_generator/src
diff options
context:
space:
mode:
Diffstat (limited to 'dhall_generator/src')
-rw-r--r--dhall_generator/src/derive.rs (renamed from dhall_generator/src/dhall_type.rs)8
-rw-r--r--dhall_generator/src/lib.rs10
-rw-r--r--dhall_generator/src/quote.rs (renamed from dhall_generator/src/dhall_expr.rs)0
3 files changed, 10 insertions, 8 deletions
diff --git a/dhall_generator/src/dhall_type.rs b/dhall_generator/src/derive.rs
index 38c871d..159ff5c 100644
--- a/dhall_generator/src/dhall_type.rs
+++ b/dhall_generator/src/derive.rs
@@ -48,7 +48,7 @@ pub fn derive_for_struct(
})
.collect();
let record =
- crate::dhall_expr::quote_exprf(dhall_core::ExprF::RecordType(fields));
+ crate::quote::quote_exprf(dhall_core::ExprF::RecordType(fields));
Ok(quote! { dhall_core::rc(#record) })
}
@@ -93,7 +93,7 @@ pub fn derive_for_enum(
.collect::<Result<_, Error>>()?;
let union =
- crate::dhall_expr::quote_exprf(dhall_core::ExprF::UnionType(variants));
+ crate::quote::quote_exprf(dhall_core::ExprF::UnionType(variants));
Ok(quote! { dhall_core::rc(#union) })
}
@@ -156,7 +156,9 @@ pub fn derive_type_inner(
// Ensure that all the fields have a Type impl
let mut where_clause = orig_where_clause.clone();
for ty in constraints.iter() {
- where_clause.predicates.push(parse_quote!(#ty: dhall::StaticType));
+ where_clause
+ .predicates
+ .push(parse_quote!(#ty: dhall::StaticType));
}
let ident = &input.ident;
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index 08ce21e..b422834 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -1,7 +1,7 @@
extern crate proc_macro;
-mod dhall_expr;
-mod dhall_type;
+mod derive;
+mod quote;
use proc_macro::TokenStream;
@@ -13,15 +13,15 @@ pub fn dhall_expr(input: TokenStream) -> TokenStream {
#[proc_macro]
pub fn expr(input: TokenStream) -> TokenStream {
- dhall_expr::expr(input)
+ quote::expr(input)
}
#[proc_macro]
pub fn subexpr(input: TokenStream) -> TokenStream {
- dhall_expr::subexpr(input)
+ quote::subexpr(input)
}
#[proc_macro_derive(StaticType)]
pub fn derive_type(input: TokenStream) -> TokenStream {
- dhall_type::derive_type(input)
+ derive::derive_type(input)
}
diff --git a/dhall_generator/src/dhall_expr.rs b/dhall_generator/src/quote.rs
index d0c5733..d0c5733 100644
--- a/dhall_generator/src/dhall_expr.rs
+++ b/dhall_generator/src/quote.rs