#tokens

macro repeater

Proc-macro for repeating tokens

1 unstable release

0.1.0 Jun 18, 2024

#1087 in Development tools

Zlib OR MIT OR Apache-2.0

14KB
243 lines

repeater

This crate provides the repeat! macro, which lets you repeat tokens. In its simplest form, repeat! takes a repeat count and the tokens to repeat:

repeat!(5 => #(repeat this 5 times)*)

See the documentation for more advanced usage, including loop variables, interpolations and nesting.

Future plans

  • Non-integer loop variables, array syntax

lib.rs:

repeater

This crate provides the repeat! macro. See the macro for how to use.

No runtime deps