Rewrite everything in rust
This commit is contained in:
parent
db5aeb333c
commit
ffad349a41
46 changed files with 1698 additions and 2410 deletions
29
hencelisp/src/bin/main.rs
Normal file
29
hencelisp/src/bin/main.rs
Normal 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}");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue