xlang 0.0.5-alpha

The xlang interpreter engine.
Documentation
use std::path::PathBuf;

use clap::Parser;
use xlang::syntax::parse;

#[derive(clap::Args)]
#[clap(author, version, about, long_about = None)]
struct Run {
    pub input: PathBuf,
}

#[derive(clap::Parser)]
#[clap(author, version, about, long_about = None)]
enum Subcommand {
    Run(Run),
}

fn main() {
    match Subcommand::parse() {
        Subcommand::Run(run) => {
            let file = match std::fs::read_to_string(run.input) {
                Ok(file) => file,
                Err(_) => {
                    println!("Cannot open source file.");
                    std::process::exit(0);
                }
            };

            println!("{:#?}", parse(&file));
        }
    }
}