Crates.io | zalgo-codec-macro |
lib.rs | zalgo-codec-macro |
version | 0.1.32 |
source | src |
created_at | 2022-11-18 17:11:03.555869 |
updated_at | 2024-11-23 18:10:41.171085 |
description | Provides the zalgo_embed! macro for compiling source code that's been converted into a single grapheme cluster by the zalgo-codec-common crate |
homepage | |
repository | https://github.com/JSorngard/zalgo_codec/tree/main/macro |
max_upload_size | |
id | 718017 |
size | 23,635 |
This crate provides the macro part of the crate zalgo-codec
by defining the procedural macros zalgo_embed!
and zalgofy!
.
The first 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.
This lets you reach new lows in the field of self-documenting code.
The second lets you encode a string into a single grapheme cluster at compile time.
If we run zalgo-codec-common::zalgo_encode
on the string "fn square(x: i32) -> i32 {x * x}" we can include the square
function in our program by putting the resulting grapheme cluster inside zalgo_embed!
:
zalgo_embed!("E͎͓͕͉̞͉͆̀͑́͒̈̀̓̒̉̀̍̀̓̒̀͛̀̊̀͘̚͘͘͝ͅ");
assert_eq!(square(10), 100);