Skip to main content

build_match_arg_helpers

Function build_match_arg_helpers 

Source
pub(crate) fn build_match_arg_helpers(
    match_arg_param_info: &[(String, String, &Type)],
    parsed: &MiniextendrFunctionParsed,
    c_ident_str: &str,
    cfg_attrs: &[Attribute],
) -> Vec<TokenStream>
Expand description

Emit the extern "C-unwind" helper + R_CallMethodDef registration for each standalone-fn match_arg param.

Each helper returns the enum’s CHOICES wrapped in a STRSXP so the R wrapper’s prelude can call match.arg(x, .Call(helper, ...)). Factored out of the miniextendr fn body so the entry point doesn’t own the quote! scaffolding.