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
pub mod generated;

mod util;
pub use util::{Error, ParseHook};
mod token;
pub use token::{TokenImpl, TokenStream, Tokenizer, TokenizerAction};
mod semantic;
pub use semantic::{SemInfoImpl, Semantic, Span};
mod env;
pub use env::{ContextImpl, EnvImpl, EnvMode, Environment, RootParser};

pub mod gen;
#[macro_export]
macro_rules! tree_cast {
    (($($t:tt)*) $var:expr ) => {
        match $var {
            $($t)*(x) => x,
            _ => panic!(
                "Unable to tree_cast: Expected {}, got {:?}",
                stringify!($enum_variant),
                $var
            ),
        }
    };
}