2024-12-21 14:35:55 -05:00
|
|
|
#![feature(panic_payload_as_str)]
|
|
|
|
use core::{
|
|
|
|
panic::set_panic_hook,
|
|
|
|
repl::{handler::COMMAND_MANAGER, setup},
|
|
|
|
splash, workspace,
|
|
|
|
};
|
2024-12-01 16:02:06 -05:00
|
|
|
|
2024-12-21 14:35:55 -05:00
|
|
|
use colored::Colorize;
|
2024-12-21 16:28:32 -05:00
|
|
|
use mlua::Lua;
|
2024-12-21 14:35:55 -05:00
|
|
|
use tokio::runtime;
|
2024-12-01 16:02:06 -05:00
|
|
|
|
2024-12-19 20:54:46 -05:00
|
|
|
pub mod core;
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-21 14:35:55 -05:00
|
|
|
fn main() -> anyhow::Result<()> {
|
|
|
|
if !cfg!(debug_assertions) {
|
|
|
|
println!("{}", "Debug mode disabled".bright_blue());
|
|
|
|
set_panic_hook();
|
|
|
|
}
|
|
|
|
let runtime = runtime::Builder::new_current_thread()
|
|
|
|
.enable_all()
|
|
|
|
.build()?;
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-21 14:35:55 -05:00
|
|
|
runtime.block_on(async {
|
|
|
|
setup();
|
|
|
|
splash::print_splash();
|
|
|
|
COMMAND_MANAGER.read().execute("help", None)?;
|
|
|
|
let t = tokio::spawn(core::repl::input::handle_repl());
|
|
|
|
t.await??;
|
2024-12-21 16:28:32 -05:00
|
|
|
Ok::<(), anyhow::Error>(())
|
2024-12-21 14:35:55 -05:00
|
|
|
})?;
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-01 16:02:06 -05:00
|
|
|
Ok(())
|
|
|
|
}
|