use proc_macro2::Ident;
use proc_macro2::TokenStream;
#[derive(Clone)]
pub struct GeneratorState {
pub name: Ident,
pub args: Vec<Ident>,
pub result: Ident,
pub is_fake_async: bool,
pub scope: Ident,
pub info: Ident,
pub parts: Ident,
pub fn_args: Ident,
pub opctx: Ident,
pub opstate: Ident,
pub js_runtime_state: Ident,
pub fast_api_callback_options: Ident,
pub retval: Ident,
pub slow_function: Ident,
pub fast_function: Ident,
pub fast_function_metrics: Ident,
pub promise_id: Ident,
pub self_ty: Ident,
pub moves: Vec<TokenStream>,
pub needs_args: bool,
pub needs_retval: bool,
pub needs_scope: bool,
pub needs_parts: bool,
pub needs_fast_isolate: bool,
pub needs_isolate: bool,
pub needs_opstate: bool,
pub needs_opctx: bool,
pub needs_stack_trace: bool,
pub needs_js_runtime_state: bool,
pub needs_fast_api_callback_options: bool,
pub needs_self: bool,
pub use_this_cppgc: bool,
pub try_unwrap_cppgc: Ident,
}
macro_rules! gs_quote {
($generator_state:ident( $($idents:ident),* ) => $quotable:tt) => {
{
$(
let $idents = &$generator_state.$idents;
)*
quote! $quotable
}
}
}
macro_rules! gs_extract {
($generator_state:ident( $($idents:ident),* )) => {
$(
let $idents = &$generator_state.$idents;
)*
}
}
pub(crate) use gs_extract;
pub(crate) use gs_quote;