Rewrite everything in rust

This commit is contained in:
Dominic Grimm 2022-07-17 20:24:49 +02:00
parent db5aeb333c
commit ffad349a41
No known key found for this signature in database
GPG key ID: A6C051C716D2CE65
46 changed files with 1698 additions and 2410 deletions

29
hencelisp/src/bin/main.rs Normal file
View file

@ -0,0 +1,29 @@
use clap::{Parser, Subcommand};
use hencelisp::*;
use std::fs;
#[derive(Debug, Parser)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(subcommand)]
commands: Commands,
}
#[derive(Debug, Subcommand)]
enum Commands {
#[clap(about = "Lexes source code and outputs tokens")]
Lex {
#[clap(value_parser)]
src: String,
},
}
fn main() {
let args = Cli::parse();
match args.commands {
Commands::Lex { src } => {
let source = fs::read_to_string(src).unwrap();
println!("{source}");
}
}
}