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
//! Unified error handling for `vespera_macro`.
//!
//! This module centralizes error handling for all proc-macro operations,
//! ensuring consistent span-based error reporting at compile time.
//!
//! # Overview
//!
//! All proc-macro operations should return [`MacroResult<T>`] instead of panicking,
//! allowing the Rust compiler to display user-friendly error messages with proper source locations.
//!
//! # Key Functions
//!
//! - [`err_call_site`] - Create an error at the macro call site
//! - [`err_spanned`] - Create an error at a specific AST node location
//! - [`IntoSynError`] - Convert other error types to `syn::Error`
//!
//! # Example
//!
//! ```ignore
//! fn process_something(input: TokenStream) -> MacroResult<TokenStream> {
//! let data = syn::parse2(input)?;
//! // ... validation ...
//! if invalid {
//! return Err(err_call_site("invalid input format"));
//! }
//! Ok(quote! { /* ... */ })
//! }
//! ```
use Span;
use Error;
/// Result type for all macro operations.
pub type MacroResult<T> = ;
/// Create an error at the call site.