1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// PDA current state get/set
// Double mutable ref in self
#[macro_export]
macro_rules! last {
    ($_self:ident) => {
        $_self.stack.last().expect("one state in stack")
    };
}

#[macro_export]
macro_rules! last_mut {
    ($_self:ident) => {
        $_self.stack.last_mut().expect("one state in stack")
    };
}