1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#[macro_export]
macro_rules! status {
    ($name:expr, $status:expr) => {
        ($status, DebugRepr::new($name, $status))
    };
}

#[macro_export]
macro_rules! iff {
    ($cond:expr, $a:expr, $b:expr) => {
        Behavior::If(
            stringify!($cond).to_string(),
            // Box::new($cond),
            $cond,
            Box::new($a),
            Box::new($b),
        )
    };
}

#[macro_export]
macro_rules! action {
    ($name:expr, $a:expr) => {
        Behavior::Action($name.to_owned(), $a)
    };
}

#[macro_export]
macro_rules! action_success {
    ($name:expr, $a:expr) => {
        Behavior::ActionSuccess($name.to_owned(), $a)
    };
}

#[macro_export]
macro_rules! sequence {
    ($($x:expr),+) => {
        Behavior::Sequence(vec![$($x),+])
    }
}