forked from katzen-cafe/iowo
lang: basic parser
This commit is contained in:
parent
ae86ae29ab
commit
ca84af4e1b
11 changed files with 362 additions and 33 deletions
17
crates/lang/src/main.rs
Normal file
17
crates/lang/src/main.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use std::{fs, path::PathBuf};
|
||||
|
||||
use clap::Parser;
|
||||
use lang::parser::parse;
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
file: PathBuf,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
let f = fs::read_to_string(args.file).expect("failed to read file");
|
||||
|
||||
println!("file: {f}\n");
|
||||
println!("parsed: {:?}", parse(&f))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue