mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-15 00:55:05 +01:00
pretty colors
This commit is contained in:
parent
79ab4bbb75
commit
bf2ea3f7f4
10 changed files with 54 additions and 52 deletions
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::token::Token;
|
||||
|
||||
mod ast;
|
||||
mod parser;
|
||||
mod pre;
|
||||
|
|
@ -48,6 +50,18 @@ impl Debug for Span {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn parse_file(src: &str) {
|
||||
println!("{src}");
|
||||
fn lex_and_pre(src: &str) -> impl Iterator<Item = (Token<'_>, Span)> + '_ {
|
||||
let pre_tokens = pre::preprocess_tokens(src);
|
||||
token::pre_tokens_to_tokens(pre_tokens)
|
||||
}
|
||||
|
||||
pub fn parse_file(src: &str) {
|
||||
let lexer = lex_and_pre(src);
|
||||
let declarations = parser::parse_declarations(lexer);
|
||||
match declarations {
|
||||
Ok(declarations) => {
|
||||
dbg_pls::color!(declarations);
|
||||
}
|
||||
Err(err) => eprintln!("error :(\n{:#?}", err),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue