zalgo-codec-macro

Crates.iozalgo-codec-macro
lib.rszalgo-codec-macro
version0.1.32
sourcesrc
created_at2022-11-18 17:11:03.555869
updated_at2024-11-23 18:10:41.171085
descriptionProvides the zalgo_embed! macro for compiling source code that's been converted into a single grapheme cluster by the zalgo-codec-common crate
homepage
repositoryhttps://github.com/JSorngard/zalgo_codec/tree/main/macro
max_upload_size
id718017
size23,635
Johanna Sörngård (JSorngard)

documentation

README

zalgo-codec-macro

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.

Example

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);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 886

cargo fmt