Skip to main content

Module debug

Module debug 

Source
Expand description

Debug formatting and printing for template expansions. Debug formatting and printing for template expansions.

Used by the #[zyn::debug] macro to print expanded token streams or the template AST to stderr during development. Not intended for production use.

§Example

// Replace zyn! with zyn::debug! to print the expansion to stderr:
zyn::debug! { fn {{ name | snake }}() {} }
// stderr: fn hello_world() {}

Functions§

ast
Returns a human-readable representation of the template AST.
fmt
Formats a token string with indentation and line breaks.
print
Pretty-prints the generated token stream to stderr.
raw
Returns the raw expansion code with internal names cleaned up.