summaryrefslogtreecommitdiff
path: root/dhall_generator/src/lib.rs
blob: 9cf944a5c9845e6ba075d2438258df2f1fd5d8d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! This crate contains the code-generation primitives for the [dhall-rust][dhall-rust] crate.
//! This is highly unstable and breaks regularly; use at your own risk.
//!
//! [dhall-rust]: https://github.com/Nadrieril/dhall-rust

extern crate proc_macro;

mod derive;
mod quote;

use proc_macro::TokenStream;

// Deprecated
#[proc_macro]
pub fn dhall_expr(input: TokenStream) -> TokenStream {
    subexpr(input)
}

#[proc_macro]
pub fn expr(input: TokenStream) -> TokenStream {
    quote::expr(input)
}

#[proc_macro]
pub fn subexpr(input: TokenStream) -> TokenStream {
    quote::subexpr(input)
}

#[proc_macro_derive(SimpleStaticType)]
pub fn derive_simple_static_type(input: TokenStream) -> TokenStream {
    derive::derive_simple_static_type(input)
}