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§
- Used to parse args passed to the inner pro macro auto-generated by
import_tokens_attr_internal
. - Used to parse args that were passed to
forward_tokens_internal
. - Used to parse args that were passed to
forward_tokens_internal
andforward_tokens_inner_internal
. - Used to parse args that were passed to
forward_tokens_inner_internal
. - Used to parse the args for the
import_tokens_internal
function. - Used to parse the args for the
import_tokens_inner_internal
function. - Generically parses a proc macro definition with support for all variants.
Enums§
- Delineates the different types of proc macro
Constants§
- Constant used to load the configured location for
macro_magic
that will be used in generated macro code.
Traits§
- Should be implemented by structs that will be passed to
#[with_custom_parsing(..)]
. Such structs should also implementsyn::parse::Parse
.
Functions§
- Internal implementation of
export_tokens_alias!
. Allows creating a renamed/rebranded macro that does the same thing as#[export_tokens]
- The internal code behind the
#[export_tokens]
attribute macro. - Produces the full path for the auto-generated callback-based decl macro that allows us to forward tokens across crate boundaries.
- Resolves to the path of the
#[export_tokens]
macro for the given item path. - “Flattens” an
Ident
by converting it to snake case. - Used by
forward_tokens_internal
. - The internal implementation for the
forward_tokens
macro. - Internal implementation for the
#[import_tokens_attr]
attribute. - The internal implementation for the
import_tokens_inner
macro. - The internal implementation for the
import_tokens
macro. - Internal implementation for the
#[import_tokens_proc]
attribute. - Safely access a subpath of
macro_magic
- Safely access the
macro_magic
root based on theMACRO_MAGIC_ROOT
env var, which defaults to::macro_magic
, but can be configured via the[env]
section of.cargo/config.toml
- Parses a proc macro function from a
TokenStream2
expecting only the specifiedmacro_type
- Safely access a subpath of
macro_magic::__private
- Returns the specified string in snake_case
- The internal implementation for the
#[with_custom_parsing(..)
attribute macro.