1pub mod ast;
2pub mod case;
3pub mod debug;
4pub mod diagnostic;
5pub mod extract;
6pub mod ident;
7pub mod meta;
8pub mod pipes;
9pub mod types;
10
11#[cfg(feature = "ext")]
12pub mod ext;
13
14pub use diagnostic::*;
15pub use extract::*;
16pub use meta::*;
17pub use types::Input;
18
19pub type Result<T> = diagnostic::Result<T>;
20
21#[macro_export]
22macro_rules! parse {
23 ($s:literal => $ty:ty) => {
24 $crate::syn::parse_str::<$ty>($s)
25 };
26 ($s:literal) => {
27 $crate::syn::parse_str($s)
28 };
29 ($ts:expr => $ty:ty) => {
30 $crate::syn::parse2::<$ty>($ts)
31 };
32 ($ts:expr) => {
33 $crate::syn::parse2($ts)
34 };
35}
36
37#[macro_export]
38macro_rules! parse_input {
39 ($($tt:tt)*) => { $crate::syn::parse_macro_input!($($tt)*) }
40}
41
42pub use proc_macro2::{Span, TokenStream};
43pub use quote::{ToTokens, format_ident};
44
45pub use proc_macro2;
46pub use quote;
47pub use syn;
48
49pub trait Expand {
50 fn expand(
51 &self,
52 output: &proc_macro2::Ident,
53 idents: &mut ident::Iter,
54 ) -> proc_macro2::TokenStream;
55}
56
57pub trait Render {
58 fn render(&self, input: &types::Input) -> proc_macro2::TokenStream;
59}
60
61pub trait Pipe {
62 type Input;
63 type Output: quote::ToTokens;
64
65 fn pipe(&self, input: Self::Input) -> Self::Output;
66}