Discontinued
This crate has been renamed to repetitive.
Please use that instead.
See https://github.com/Noam2Stein/repetitive.
macro_loop
macro_loop is a macro for writing repetitive Rust code using loops, conditionals, and bindings.
This is similar to the paste, seq-macro and tt-call crates,
but attempts to make it more readable and scalable.
macro_loop supports:
- for loops - loops over list values which can be literals or identifiers.
 - if statements - declares a condition over fragments and only emits the body if the condition is met.
 - concat idents/strings - merges idents/string into one anywhere in the code.
 
These features together allow for simple, readable and scalable macro logic.
Examples
Concat:
macro_loop! 
// outputs:
// struct Type;
macro_loop! 
For loops:
macro_loop! 
// outputs:
// struct Vec2;
// struct Vec3;
// struct Vec4;
macro_loop! 
// outputs:
// struct boolx2;
// struct boolx3;
// struct boolx4;
// struct i32x2;
// ...
If statements:
// Only prints if `$a` and `$b` are NOT equal.
Let statements:
// Declare all swizzle fns
Patterns: