use eprocedural::*;
proc!( init_counter {
let counter = 10;
} defines counter: u32);
proc!( init_flag {
let flag = true;
} defines flag: bool);
proc!( update_counter with counter: u32 {
*counter -= 1;
});
proc!( update_flag with flag: bool, counter: u32 {
if *counter == 0 {
*flag = false
}
});
fn main() {
with!(init_counter);
with!(init_flag);
while flag {
with!(update_counter);
with!(update_flag);
}
}