mirror of
https://github.com/Noratrieb/ub.git
synced 2026-01-15 09:05:05 +01:00
update!
This commit is contained in:
parent
2f051ed45b
commit
ff78ae710b
3 changed files with 102 additions and 155 deletions
|
|
@ -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()))
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ impl Printer {
|
|||
self.word(" ");
|
||||
}
|
||||
self.print_block(&fn_decl.body);
|
||||
self.linebreak();
|
||||
}
|
||||
Item::StructDecl(_) => {
|
||||
todo!()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue