about summary refs log tree commit diff
path: root/users/aspen/achilles/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/aspen/achilles/src/main.rs')
-rw-r--r--users/aspen/achilles/src/main.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/users/aspen/achilles/src/main.rs b/users/aspen/achilles/src/main.rs
new file mode 100644
index 0000000000..5ae1b59b3a
--- /dev/null
+++ b/users/aspen/achilles/src/main.rs
@@ -0,0 +1,36 @@
+use clap::Clap;
+
+pub mod ast;
+pub mod codegen;
+pub(crate) mod commands;
+pub(crate) mod common;
+pub mod compiler;
+pub mod interpreter;
+pub(crate) mod passes;
+#[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()?),
+    }
+}