organic/src/main.rs

27 lines
801 B
Rust
Raw Normal View History

2023-03-23 23:35:32 +00:00
#![feature(round_char_boundary)]
2023-03-25 15:27:38 +00:00
use crate::parser::document;
use tracing::Level;
2022-11-25 22:54:26 +00:00
use tracing_subscriber::fmt::format::FmtSpan;
2022-07-16 03:26:49 +00:00
mod parser;
const TEST_DOC: &'static str = include_str!("../toy_language.txt");
fn main() -> Result<(), Box<dyn std::error::Error>> {
let format = tracing_subscriber::fmt::format()
.with_file(true)
.with_line_number(true)
.with_thread_ids(false)
.with_target(false);
let subscriber = tracing_subscriber::fmt()
.event_format(format)
.with_max_level(Level::TRACE)
2022-11-25 22:54:26 +00:00
.with_span_events(FmtSpan::ENTER | FmtSpan::EXIT)
.finish();
tracing::subscriber::set_global_default(subscriber)?;
2023-03-25 15:27:38 +00:00
let parsed = document(TEST_DOC);
println!("{}\n\n\n", TEST_DOC);
println!("{:#?}", parsed);
2022-07-16 03:26:49 +00:00
Ok(())
}