try out chumsky parser lib - wip

This commit is contained in:
2021-10-30 23:52:09 +02:00
parent 2267eed21c
commit 7ef98f0e96
4 changed files with 689 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ mod ast;
mod constfold;
mod emit;
mod parser;
mod parser2;
mod typecheck;
fn main() -> Result<()> {
@@ -17,6 +18,10 @@ fn main() -> Result<()> {
let mut input = String::new();
File::open(&filename)?.read_to_string(&mut input)?;
if let Err(_) = parser2::parse(&input) {
bail!("Parse failed");
}
let mut script = match parser::parse(input.as_str()) {
Ok(script) => script,
Err(err) => {