Skip to main content

Crate macro_schema_core

Crate macro_schema_core 

Source
Expand description

proc_macro2 implementation of macro-schema.

Depend on the macro-schema crate, not this one. This crate holds the implementation behind its define! and expand! macros as ordinary Rust functions, define and expand, so it can be unit-tested and stepped through in a debugger without going through the compiler’s macro expander. expand_definition does the same for a client: it expands a call of a macro straight from that macro’s define! input. The repository’s specs/MACRO_SCHEMA_SPEC.md explains how the pieces fit together.

Structs§

Error
Error returned when a Syn parser cannot parse the input tokens.

Functions§

define
Implements macro_schema::define!: parses and checks a definition, then emits a hidden exported macro_rules! wrapper plus a bare-name use alias.
expand
Implements macro_schema::expand!: validates one call of a defined macro and renders its template, or calls its escape-hatch generator.
expand_definition
Expands one call of the macro that a define! input declares, as the generated wrapper would, so a client can test or debug its own macros as ordinary functions.

Type Aliases§

Result
The result of a Syn parser.