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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Compile README.docify.md to README.md
compile_markdown!;
pub use *;
pub use *;
pub use *;
pub use always_context_build;
/// Enables procedural macros to return `anyhow::Result<TokenStream>` for ergonomic error handling.
///
/// This attribute wraps proc-macro functions to automatically handle `anyhow::Result` return types,
/// converting errors into appropriate `compile_error!` tokens.
///
/// # Usage
///
/// ```rust,ignore
/// use anyhow::Context;
/// use proc_macro::TokenStream;
///
/// #[proc_macro]
/// #[anyhow_result]
/// pub fn my_macro(input: TokenStream) -> anyhow::Result<TokenStream> {
/// let parsed: syn::ItemStruct = syn::parse(input)
/// .context("Expected a struct definition")?;
///
/// // Your macro logic here
/// Ok(quote! { /* generated code */ }.into())
/// }
/// ```
///
/// # Error Handling
///
/// When your function returns an `Err`, `anyhow_result` automatically converts it:
/// - **`#[proc_macro]` and `#[proc_macro_derive]`**: Returns `compile_error!` with the error message
/// - **`#[proc_macro_attribute]`**: Returns `compile_error!` followed by the original input item
///
/// # See Also
///
/// - [`anyhow`](https://docs.rs/anyhow/) - Error handling library
/// - [`syn`](https://docs.rs/syn/) - Rust code parsing
/// - [`quote`](https://docs.rs/quote/) - Code generation
pub use anyhow_result;
pub use ;
// === Helper Function Exports ===
/// Helper utilities for building procedural macros
pub use *;