forked from AbleOS/ableos_userland
29 lines
500 B
Rust
29 lines
500 B
Rust
#![feature(result_option_inspect)]
|
|
#![allow(non_snake_case)]
|
|
|
|
mod ast;
|
|
mod lexer;
|
|
mod parser;
|
|
|
|
const TEST: &str = include_str!("../assets/why.idl");
|
|
|
|
fn main() {
|
|
let res = parser::parse(TEST);
|
|
match res {
|
|
Ok(ast) => {
|
|
println!("{:?}", ast);
|
|
}
|
|
Err(e) => println!("{}", e),
|
|
}
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! unwrap_match {
|
|
($x:expr, $m:pat => $a:expr) => {
|
|
match $x {
|
|
$m => $a,
|
|
_ => unreachable!(),
|
|
}
|
|
};
|
|
}
|