|
@@ -1,12 +1,12 @@
|
|
|
#[macro_export]
|
|
|
macro_rules! system {
|
|
|
- ($name:ident $pat:tt => $block:block ) => {
|
|
|
+ ($name:ident $pat:tt => $($rest:tt)* ) => {
|
|
|
struct $name;
|
|
|
impl<'a> specs::System<'a> for $name {
|
|
|
type SystemData = args_to_systemdata!($pat);
|
|
|
fn run(&mut self, args_to_pat!($pat): Self::SystemData) {
|
|
|
for args_to_pat!($pat) in args_to_join!($pat).join() {
|
|
|
- $block
|
|
|
+ $($rest)*
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -77,8 +77,7 @@ mod tests {
|
|
|
type Storage = specs::VecStorage<Mov>;
|
|
|
}
|
|
|
|
|
|
- system!{ Foo (_x: Mov, mut y: Pos) => {
|
|
|
+ system!{ Foo (_x: Mov, mut y: Pos) =>
|
|
|
y.x += 1;
|
|
|
}
|
|
|
- }
|
|
|
}
|