diff options
Diffstat (limited to '')
-rw-r--r-- | dhall/src/lib.rs | 6 | ||||
-rw-r--r-- | dhall/src/traits.rs (renamed from dhall/src/dhall_type.rs) | 0 | ||||
-rw-r--r-- | dhall/tests/traits.rs (renamed from dhall/tests/dhall_type.rs) | 0 | ||||
-rw-r--r-- | dhall_generator/src/derive.rs (renamed from dhall_generator/src/dhall_type.rs) | 8 | ||||
-rw-r--r-- | dhall_generator/src/lib.rs | 10 | ||||
-rw-r--r-- | dhall_generator/src/quote.rs (renamed from dhall_generator/src/dhall_expr.rs) | 0 |
6 files changed, 13 insertions, 11 deletions
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index 5a155c8..7439312 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -10,14 +10,14 @@ mod normalize; pub use crate::normalize::*; pub mod binary; -mod dhall_type; pub mod imports; +mod traits; pub mod typecheck; -pub use crate::dhall_type::*; +pub use crate::imports::*; +pub use crate::traits::*; pub use dhall_generator::expr; pub use dhall_generator::subexpr; pub use dhall_generator::StaticType; -pub use crate::imports::*; // pub struct DhallExpr(dhall_core::DhallExpr); diff --git a/dhall/src/dhall_type.rs b/dhall/src/traits.rs index 64e07d9..64e07d9 100644 --- a/dhall/src/dhall_type.rs +++ b/dhall/src/traits.rs diff --git a/dhall/tests/dhall_type.rs b/dhall/tests/traits.rs index ac6b5e6..ac6b5e6 100644 --- a/dhall/tests/dhall_type.rs +++ b/dhall/tests/traits.rs 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 |