merge(glittershark/achilles): Subtree import at 'b93268085a'
Imported from https://github.com/glittershark/achilles/ git-subtree-dir: users/glittershark/achilles git-subtree-mainline:4d193f2395git-subtree-split:b93268085aChange-Id: I64a583b454bbe03e20358ad7808939a4cbc212ba
This commit is contained in:
commit
b6895a5b30
33 changed files with 4508 additions and 0 deletions
38
users/glittershark/achilles/src/main.rs
Normal file
38
users/glittershark/achilles/src/main.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#![feature(str_split_once)]
|
||||
#![feature(or_insert_with_key)]
|
||||
|
||||
use clap::Clap;
|
||||
|
||||
pub mod ast;
|
||||
pub mod codegen;
|
||||
pub(crate) mod commands;
|
||||
pub(crate) mod common;
|
||||
pub mod compiler;
|
||||
pub mod interpreter;
|
||||
#[macro_use]
|
||||
pub mod parser;
|
||||
pub mod tc;
|
||||
|
||||
pub use common::{Error, Result};
|
||||
|
||||
#[derive(Clap)]
|
||||
struct Opts {
|
||||
#[clap(subcommand)]
|
||||
subcommand: Command,
|
||||
}
|
||||
|
||||
#[derive(Clap)]
|
||||
enum Command {
|
||||
Eval(commands::Eval),
|
||||
Compile(commands::Compile),
|
||||
Check(commands::Check),
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let opts = Opts::parse();
|
||||
match opts.subcommand {
|
||||
Command::Eval(eval) => Ok(eval.run()?),
|
||||
Command::Compile(compile) => Ok(compile.run()?),
|
||||
Command::Check(check) => Ok(check.run()?),
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue