1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
macro_rules! with_node {
    ($builder:expr, $kind:ident, $($content:tt)*) => {
        {
            $builder.start_node($kind.into());
            let res = $($content)*;
            $builder.finish_node();
            res
        }
    };
}

macro_rules! whitelisted {
    ($self:expr, $kind:ident, $($content:tt)*) => {
        {
            $self.whitelist_token($kind);
            let res = $($content)*;
            $self.blacklist_token($kind);
            res
        }
    };
}