This commit is contained in:
nora 2023-03-04 11:19:54 +01:00
parent 2f051ed45b
commit ff78ae710b
3 changed files with 102 additions and 155 deletions

View file

@ -4,6 +4,7 @@
use std::path::PathBuf;
use ariadne::{Color, Fmt, Label, Report, ReportKind, Source};
use chumsky::prelude::Simple;
use logos::Logos;
use crate::lexer::Token;
@ -23,12 +24,14 @@ fn main(uwu: u64, owo: ptr WOW) -> ptr u64 {
let uwu = &1;
let owo = yeet(1+2*3, AA);
if 1 {
if 1 {
10;
} else {}
if 1 { if 1 { if 1 {} } }
}
fn aa() {}
";
let lexer = Token::lexer(src);
@ -41,6 +44,10 @@ fn main(uwu: u64, owo: ptr WOW) -> ptr u64 {
println!("{}", pretty::pretty_print_ast(&file));
}
report_errors(src, errors);
}
fn report_errors(src: &str, errors: Vec<Simple<Token<'_>>>) {
errors
.into_iter()
.map(|e| e.map(|c| c.to_string()))

View file

@ -55,6 +55,7 @@ impl Printer {
self.word(" ");
}
self.print_block(&fn_decl.body);
self.linebreak();
}
Item::StructDecl(_) => {
todo!()