rukt 0.2.0

Simple Rust dialect for token-based compile-time scripting
Documentation

rukt

Simple Rust dialect for token-based compile-time scripting.

use rukt::rukt;

rukt!{
    let operations = {
        add: +,
        sub: -,
        mul: *,
        div: /,
    };
    let {$($name:ident: $operator:tt,)*} = operations;
    expand {
        $(
            fn $name(a: u32, b: u32) {
                a $operator b
            }
        )*
    }
}

License

Licensed under MIT or Apache-2.0.