Skip to main content

Module reexport

Module reexport 

Source
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.

Structsยง

Item ๐Ÿ”’
One pkg::name item.

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 its r#.
entries ๐Ÿ”’
One MX_REEXPORTS entry per item, in an anonymous const _ 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 name canโ€™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 package is 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 (None after the last). Delimited groups are single token trees, so a comma inside one does not split.