proc_macro_kwargs/
lib.rs

1//! Keyword argument parsing for function-like procedural macros.
2#![deny(missing_docs)]
3pub use proc_macro_kwargs_derive::MacroKeywordArgs;
4
5pub mod args;
6pub mod parse;
7
8pub use args::MacroKeywordArgs;
9pub use parse::MacroArg;
10
11/// Combine multiple `syn` errors into a single error struct
12///
13/// Panics if the specified vector is empty.
14///
15/// NOTE: This is an internal implementation detail
16#[doc(hidden)]
17pub fn combine_errors(errors: Vec<syn::Error>) -> syn::Error {
18    let mut iter = errors.into_iter();
19    let mut error = iter.next().expect("empty Vec");
20    for extra in iter {
21        error.combine(extra);
22    }
23    error
24}