Expand description
Write-time placeholder & symbol-name formatting for the match_arg pipeline.
All four shapes (choices_placeholder, param_doc_placeholder,
choices_helper_c_name, choices_helper_def_ident) share the same
{c_ident_without_prefix}_{r_param} stem so the cdylibโs write-time pass
can correlate them. Keep them together so the shape canโt drift.
The c_ident_without_prefix input has C_ already stripped (or is a stem
already, e.g. MyType__method). Callers that have a full c_ident should
pass c_ident.trim_start_matches("C_").
All four helpers call c_stem(...) internally so callers may also pass a
full c_ident (e.g. "C_my_fn") โ the C_ prefix is normalized away.
Functionsยง
- c_stem ๐
- choices_
entry_ ๐tokens - Emit the
MX_MATCH_ARG_CHOICESstatic + its linkme registration. - choices_
helper_ ๐c_ name - C symbol name for the helper fn that returns the enumโs choices SEXP, called from the R wrapperโs match.arg prelude.
- choices_
helper_ ๐def_ ident - Rust ident holding the
R_CallMethodDeffor the match_arg choices helper. - choices_
placeholder ๐ - R-side placeholder that the cdylib resolves to a
c("a", "b", ...)literal at write time. Substituted byMX_MATCH_ARG_CHOICESentries. - extract_
match_ ๐arg_ default - Extract the unquoted form of a user-supplied
default = "..."literal for amatch_argparameter. - param_
doc_ ๐entry_ tokens - Emit the
MX_MATCH_ARG_PARAM_DOCSstatic + its linkme registration. - param_
doc_ ๐placeholder - R-side placeholder for the
@paramdoc line, substituted byMX_MATCH_ARG_PARAM_DOCSentries at write time. See #210. - placeholder_
ident_ ๐suffix - Derive a safe Rust ident from a write-time placeholder string.