Crate macro_magic_core

Source
Expand description

This crate contains most of the internal implementation of the macros in the macro_magic_macros crate. For the most part, the proc macros in macro_magic_macros just call their respective _internal variants in this crate.

Structs§

AttrItemWithExtra
Used to parse args passed to the inner pro macro auto-generated by import_tokens_attr_internal.
ForwardTokensArgs
Used to parse args that were passed to forward_tokens_internal.
ForwardTokensExtraArg
Used to parse args that were passed to forward_tokens_internal and forward_tokens_inner_internal.
ForwardedTokens
Used to parse args that were passed to forward_tokens_inner_internal.
ImportTokensArgs
Used to parse the args for the import_tokens_internal function.
ImportedTokens
Used to parse the args for the import_tokens_inner_internal function.
ProcMacro
Generically parses a proc macro definition with support for all variants.

Enums§

ProcMacroType
Delineates the different types of proc macro

Constants§

MACRO_MAGIC_ROOT
Constant used to load the configured location for macro_magic that will be used in generated macro code.

Traits§

ForeignPath
Should be implemented by structs that will be passed to #[with_custom_parsing(..)]. Such structs should also implement syn::parse::Parse.

Functions§

export_tokens_alias_internal
Internal implementation of export_tokens_alias!. Allows creating a renamed/rebranded macro that does the same thing as #[export_tokens]
export_tokens_internal
The internal code behind the #[export_tokens] attribute macro.
export_tokens_macro_ident
Produces the full path for the auto-generated callback-based decl macro that allows us to forward tokens across crate boundaries.
export_tokens_macro_path
Resolves to the path of the #[export_tokens] macro for the given item path.
flatten_ident
“Flattens” an Ident by converting it to snake case.
forward_tokens_inner_internal
Used by forward_tokens_internal.
forward_tokens_internal
The internal implementation for the forward_tokens macro.
import_tokens_attr_internal
Internal implementation for the #[import_tokens_attr] attribute.
import_tokens_inner_internal
The internal implementation for the import_tokens_inner macro.
import_tokens_internal
The internal implementation for the import_tokens macro.
import_tokens_proc_internal
Internal implementation for the #[import_tokens_proc] attribute.
macro_magic_path
Safely access a subpath of macro_magic
macro_magic_root
Safely access the macro_magic root based on the MACRO_MAGIC_ROOT env var, which defaults to ::macro_magic, but can be configured via the [env] section of .cargo/config.toml
parse_proc_macro_variant
Parses a proc macro function from a TokenStream2 expecting only the specified macro_type
private_path
Safely access a subpath of macro_magic::__private
to_snake_case
Returns the specified string in snake_case
with_custom_parsing_internal
The internal implementation for the #[with_custom_parsing(..) attribute macro.