knave 0.9.3

A small Lisp for humans and agents that infers types and ownership and compiles to readable Rust
Documentation
use std::path::PathBuf;

use super::exit_status::ExitStatus;
use super::terminal::Terminal;

pub struct EmitCommand {
    file: PathBuf,
}

impl EmitCommand {
    pub fn new(file: PathBuf) -> Self {
        Self { file }
    }

    pub fn run(self, terminal: &mut Terminal) -> ExitStatus {
        match terminal.emit(&self.file) {
            Ok(emitted) => terminal.write_output(&emitted.code),
            Err(status) => status,
        }
    }
}