Start interpreting pest output

This commit is contained in:
Joscha 2021-11-18 21:59:18 +01:00
parent 1e58672e21
commit 6e53446a08
3 changed files with 35 additions and 7 deletions

View file

@ -1,11 +1,8 @@
use std::fs;
use std::path::PathBuf;
use pest::Parser;
use structopt::StructOpt;
use parse::{MyParser, Rule};
mod commands;
mod parse;
@ -18,7 +15,7 @@ pub struct Opt {
fn main() -> anyhow::Result<()> {
let opt = Opt::from_args();
let content = fs::read_to_string(&opt.file)?;
let parsed = MyParser::parse(Rule::file, &content)?.next().unwrap();
println!("{:#?}", parsed);
let commands = parse::parse(&content)?;
println!("{:#?}", commands);
Ok(())
}