Expand description
reexport!(pkg::name, ...): R re-exports declared from Rust (#1910).
Each item is another packageβs export that this package exports too. The
macro registers one ReexportEntry per item in
miniextendr_api::registry::MX_REEXPORTS; the wrapper writer turns them
into roxygen2βs re-export blocks (@importFrom pkg name, @export,
pkg::name), one per pkg::name however many sites declare it, and
refuses a name re-exported from two packages or bound by the package
itself.
The package and a syntactic name are dot-joined identifiers
(data.table::fread, stats::na.omit); a non-syntactic name is a string
literal (magrittr::"%>%"). Every problem of one invocation is reported at
once, each on its own tokens.
Re-exportsΒ§
use proc_macro2::Span;πuse proc_macro2::TokenStream;πuse proc_macro2::TokenTree;πuse quote::ToTokens;πuse quote::quote;πuse syn::ext::IdentExt;πuse syn::parse::ParseStream;πuse syn::parse::Parser;π
StructsΒ§
- Item π
- One
pkg::nameitem.
FunctionsΒ§
- dotted_
identifiers π - Identifiers joined by
.(data.table,na.omit), read as written: a Rust keyword is an identifier here (base::as.numeric), and a raw identifier loses itsr#. - entries π
- One
MX_REEXPORTSentry per item, in an anonymousconst _so any number of invocations live side by side. The slice is host-only, so on wasm32 the invocation expands to nothing. - expand π
- Expand
reexport!(...). - name_
problem π - Why
namecanβt be re-exported, if it canβt. Written as identifiers it must be a syntactic R name; a string literal may be any non-empty ASCII text without whitespace, control characters or the quoting characters`,\and", which the generated R code and roxygen2 tags write verbatim or between quotes. - package_
problem π - Why
packageis not an R package name, if it isnβt. - parse_
item π - One item:
<dotted identifiers>::<dotted identifiers | string literal>. - parse_
items π - The items of an invocation, or every problem found in it.
- split_
items π - The input split at its top-level commas: each itemβs tokens and the comma
after it (
Noneafter the last). Delimited groups are single token trees, so a comma inside one does not split.