mirror of
https://github.com/exoticorn/curlywas.git
synced 2026-01-20 11:46:43 +01:00
implement type checking and constand folding for simple example
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
mod parser;
|
||||
mod ast;
|
||||
mod typecheck;
|
||||
mod constfold;
|
||||
|
||||
fn main() {
|
||||
let input = include_str!("../test.hw");
|
||||
let result = parser::parse(input);
|
||||
match result {
|
||||
Ok(script) => {dbg!(script);},
|
||||
Ok(mut script) => {
|
||||
constfold::fold_script(&mut script);
|
||||
typecheck::tc_script(&mut script).unwrap();
|
||||
dbg!(script);
|
||||
},
|
||||
Err(err) => println!("error: {}", nom::error::convert_error(input, err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user