19 lines
476 B
Rust
19 lines
476 B
Rust
use std::process;
|
|
|
|
use oyster_lineedit::readline;
|
|
use oyster_parser::ast::Code;
|
|
use oyster_runtime::{Shell, Status};
|
|
|
|
fn main() {
|
|
let mut shell = Shell::new().unwrap();
|
|
shell.builtins_mut().add_defaults();
|
|
let mut exit_code = Status::SUCCESS;
|
|
|
|
while shell.is_running() {
|
|
let prog = readline("> ").unwrap();
|
|
let ast = Code::try_from(prog.as_ref()).unwrap();
|
|
exit_code = shell.run(&ast).unwrap();
|
|
}
|
|
|
|
process::exit(exit_code.0);
|
|
}
|