lang: basic parser

This commit is contained in:
Schrottkatze 2024-04-03 00:08:00 +02:00
parent ae86ae29ab
commit ca84af4e1b
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
11 changed files with 362 additions and 33 deletions

17
crates/lang/src/main.rs Normal file
View 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))
}