crafting-interpreters/rust/rox/src/main.rs

21 lines
433 B
Rust
Raw Normal View History

2025-02-06 10:34:46 +00:00
use clap::Parser;
use rox::cli::{Cli, Commands};
fn main() {
if std::env::var_os("RUST_LOG").is_none() {
std::env::set_var("RUST_LOG", "info");
}
tracing_subscriber::fmt::init();
let cli = Cli::parse();
match &cli.command {
Commands::Compile(compile_config) => {
rox::compile(&compile_config.source);
}
Commands::Repl => {
rox::repl();
}
}
}