macro_rules! tp {
($i:ident) => { ... };
($i:ident, $e:expr) => { ... };
($i:ident, $($arg:tt)*) => { ... };
}Expand description
tp! is to used to persist the tile into the tls (thread local storage), with a given name (string literal) and return a tile
use rtile::prelude::*;
tp!(
tile_one,
"
one
two
"
);
tp!(
tile_two,
"
three
four
five
"
);
let input_tile = t!("
@{tile_one} @{tile_two}
");
let output = input_tile.to_string();
let expected_output = ts!("
one three
four
two five
");
assert_eq!(output, expected_output);