genco_macros/
requirements.rsuse proc_macro2::TokenStream;
#[derive(Debug, Default, Clone, Copy)]
pub(crate) struct Requirements {
pub(crate) lang_supports_eval: bool,
}
impl Requirements {
pub fn merge_with(&mut self, other: Self) {
self.lang_supports_eval |= other.lang_supports_eval;
}
pub fn into_check(self, receiver: &syn::Ident) -> TokenStream {
let lang_supports_eval = if self.lang_supports_eval {
Some(q::quote!(#receiver.lang_supports_eval();))
} else {
None
};
q::quote! {
#lang_supports_eval
}
}
}