Crate zalgo_codec_macro

source ·
Expand description

This crate provides the proc-macro part of the crate zalgo-codec by defining the procedural macro zalgo_embed!.

It lets you take source code that’s been converted into a single grapheme cluster by the zalgo-codec-common crate and compile it as if it was never zalgo-ified.

§Example

If we run zalgo_encode on the text fn add(x: i32, y: i32) -> i32 {x + y} we can add the add function to our program by putting the resulting grapheme cluster inside zalgo_embed!:

zalgo_embed!("E͎͉͙͉̞͉͙͆̀́̈́̈́̈̀̓̒̌̀̀̓̒̉̀̍̀̓̒̀͛̀̋̀͘̚̚͘͝");
assert_eq!(add(10, 20), 30);

Macros§

  • This macro decodes a string that has been encoded with zalgo_encode and passes the results on to the compiler.
  • At compile time this proc-macro encodes the given string literal as a single grapheme cluster.