Formatter introduced

This commit is contained in:
2025-02-07 00:47:34 +01:00
parent b94d8a64cb
commit 40c5eaf3d5
23 changed files with 608 additions and 218 deletions

View File

@@ -10,6 +10,7 @@ use clap::{Parser, Subcommand};
use futures::{Stream, TryStreamExt, io};
use orchid_base::clone;
use orchid_base::error::ReporterImpl;
use orchid_base::format::{FmtCtxImpl, take_first};
use orchid_base::logging::{LogStrategy, Logger};
use orchid_base::parse::Snippet;
use orchid_base::tree::ttv_fmt;
@@ -83,7 +84,7 @@ async fn main() -> io::Result<ExitCode> {
let mut buf = String::new();
file.read_to_string(&mut buf).unwrap();
let lexemes = lex(ctx.i.i(&buf).await, &systems, ctx).await.unwrap();
println!("{}", ttv_fmt(&lexemes).await)
println!("{}", take_first(&ttv_fmt(&lexemes, &FmtCtxImpl { i: &ctx.i }).await, true))
},
Commands::Parse { file } => {
let systems = init_systems(&args.system, &extensions).await.unwrap();